[PATCH v2] um/mm: remove redundant assignment of max_low_pfn

2024-06-14 Thread Wei Yang
Current calculation of max_low_pfn is introduced in commit af84eab20891 ("[PATCH] uml: fix LVM crash"). It is intended to set max_low_pfn to the same value as max_pfn. But I am not sure why the max_pfn is set to totalram_pages, which represents the number of usable pages in system instead of an ab

Re: [PATCH] um/mm: get max_low_pfn from memblock

2024-06-14 Thread Wei Yang
On Fri, Jun 14, 2024 at 10:51:32AM +0300, Mike Rapoport wrote: >On Fri, Jun 14, 2024 at 09:31:59AM +0200, David Hildenbrand wrote: >> On 14.06.24 03:58, Wei Yang wrote: >> > Current calculation of max_low_pfn is introduced in commit af84eab20891 >> > ("[PATCH] uml: fix LVM crash"). It is intended t

[PATCH 23/23] MAINTAINERS: Add the Microchip LAN966x OIC driver entry

2024-06-14 Thread Herve Codina
After contributing the driver, add myself as the maintainer for the Microchip LAN966x OIC driver. Signed-off-by: Herve Codina --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index d6c90161c7bf..baeb307344cd 100644 --- a/MAINTAINERS +++ b/MAINTA

[PATCH 19/23] um: virt-pci: Use irq_domain_instantiate()

2024-06-14 Thread Herve Codina
um_pci_init() uses __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), use directly irq_domain_instantiate(). Signed-off-by: Herve Codina --- arch/um/drivers/virt-pci.c | 16 ++-- 1

[PATCH 20/23] irqdomain: Remove __irq_domain_add()

2024-06-14 Thread Herve Codina
__irq_domain_add() has been replaced by irq_domain_instanciate() and so, it is no more used. Simply remove it. Signed-off-by: Herve Codina --- include/linux/irqdomain.h | 6 +- kernel/irq/irqdomain.c| 33 - 2 files changed, 1 insertion(+), 38 deletions(-

[PATCH 22/23] irqchip: Add support for LAN966x OIC

2024-06-14 Thread Herve Codina
The Microchip LAN966x outband interrupt controller (OIC) maps the internal interrupt sources of the LAN966x device to an external interrupt. When the LAN966x device is used as a PCI device, the external interrupt is routed to the PCI interrupt. Signed-off-by: Herve Codina --- drivers/irqchip/Kco

[PATCH 21/23] dt-bindings: interrupt-controller: Add support for Microchip LAN966x OIC

2024-06-14 Thread Herve Codina
The Microchip LAN966x outband interrupt controller (OIC) maps the internal interrupt sources of the LAN966x device to an external interrupt. When the LAN966x device is used as a PCI device, the external interrupt is routed to the PCI interrupt. Signed-off-by: Herve Codina Reviewed-by: Rob Herring

[PATCH 18/23] irqdomain: Convert domain creation functions to irq_domain_instantiate()

2024-06-14 Thread Herve Codina
Domain creation functions use __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), convert domain creation function to irq_domain_instantiate() Signed-off-by: Herve Codina --- kernel/irq/irqdomai

[PATCH 15/23] irqdomain: Add support for generic irq chips creation before publishing a domain

2024-06-14 Thread Herve Codina
The current API functions create an irq_domain and also publish this newly created to domain. Once an irq_domain is published, consumers can request IRQ in order to use them. Some interrupt controller drivers have to perform some more operations with the created irq_domain in order to have it read

[PATCH 17/23] irqdomain: Convert __irq_domain_add() wrappers to irq_domain_instantiate()

2024-06-14 Thread Herve Codina
__irq_domain_add() wrappers use directly __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), convert wrappers to irq_domain_instantiate() Signed-off-by: Herve Codina --- include/linux/irqdomain.

[PATCH 16/23] irqdomain: Add a resource managed version of irq_domain_instantiate()

2024-06-14 Thread Herve Codina
Add a devres version of irq_domain_instantiate(). Signed-off-by: Herve Codina --- include/linux/irqdomain.h | 2 ++ kernel/irq/devres.c | 41 +++ 2 files changed, 43 insertions(+) diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h index

[PATCH 14/23] genirq/generic_chip: Introduce init() and exit() hooks

2024-06-14 Thread Herve Codina
Most of generic chip drivers need to perform some more additional initializations on the generic chips allocated before they can be fully ready. These additional initializations need to be performed before the IRQ domain is published to avoid a race condition between IRQ consumers and suppliers.

[PATCH 12/23] irqdomain: Introduce init() and exit() hooks

2024-06-14 Thread Herve Codina
The current API does not allow additional initialization before the domain is published. This can lead to a race condition between consumers and supplier as a domain can be available for consumers before being fully ready. Introduce the init() hook to allow additional initialization before plublis

[PATCH 13/23] genirq/generic_chip: Introduce irq_domain_{alloc,remove}_generic_chips()

2024-06-14 Thread Herve Codina
The existing __irq_alloc_domain_generic_chips() use a bunch of parameters to describe the generic chips that need to be allocated. Adding more parameters and wrappers to hide new parameters in the existing code lead to more and more code without any relevant values and without any flexibility. In

[PATCH 11/23] irqdomain: Handle domain bus token in irq_domain_create()

2024-06-14 Thread Herve Codina
irq_domain_update_bus_token() is the only way to set the domain bus token. This is sub-optimal as irq_domain_update_bus_token() can be called only once the domain is created and needs to revert some operations, change the domain name and redo the operations. In order to avoid this revert/change/re

[PATCH 08/23] irqdomain: Handle domain hierarchy parent in irq_domain_instantiate()

2024-06-14 Thread Herve Codina
To use irq_domain_instantiate() from irq_domain_create_hierarchy(), irq_domain_instantiate() needs to handle the domain hierarchy parent. Handle this parent. Signed-off-by: Herve Codina --- include/linux/irqdomain.h | 6 ++ kernel/irq/irqdomain.c| 7 +++ 2 files changed, 13 insertio

[PATCH 10/23] irqdomain: Make __irq_domain_create() return an error code

2024-06-14 Thread Herve Codina
__irq_domain_create() can fail for several reasons. When it fails it returns a NULL pointer and so filters out the exact failure reason. The only user of __irq_domain_create() is irq_domain_instantiate() which can return a PTR_ERR value. On __irq_domain_create() failure, it uses an arbitrary error

[PATCH 09/23] irqdomain: Use irq_domain_instantiate() for hierarchy domain creation

2024-06-14 Thread Herve Codina
irq_domain_instantiate() handles all needs to be used in irq_domain_create_hierarchy() Avoid code duplication and use directly irq_domain_instantiate() for hierarchy domain creation. Signed-off-by: Herve Codina --- kernel/irq/irqdomain.c | 17 + 1 file changed, 5 insertions(+),

[PATCH 07/23] irqdomain: Handle additional domain flags in irq_domain_instantiate()

2024-06-14 Thread Herve Codina
In order to use irq_domain_instantiate() from several places such as irq_domain_create_hierarchy(), irq_domain_instantiate() needs to handle additional domain flags. Handle these additional flags. Suggested-by: Thomas Gleixner Signed-off-by: Herve Codina --- include/linux/irqdomain.h | 2 ++ k

[PATCH 00/23] Introduce irq_domain_instanciate()

2024-06-14 Thread Herve Codina
Hi, Previously, I sent a series related the support for the LAN966x PCI device [1] and in particular several patches related irq domain modifications and the introduction of the Microchip LAN966x OIC driver. During the review, it was asked to rework the irq domain modification in order to avoid m

[PATCH 06/23] irqdomain: Convert __irq_domain_create() to use struct irq_domain_info

2024-06-14 Thread Herve Codina
The existing __irq_domain_create() use a bunch of parameters to create an irq domain. With the introduction of irq_domain_info structure, these parameters are available in the information structure itself. Using directly this information structure allows future flexibility to add other parameters

[PATCH 05/23] irqdomain: Use a dedicated function to set the domain name

2024-06-14 Thread Herve Codina
The irq domain name computation and setting is directly done in __irq_domain_create(). This leads to a quite long __irq_domain_create() function. In order to simplify __irq_domain_create() and isolate the domain name computation and setting, move the related operations to a dedicated function. Si

[PATCH 04/23] irqdomain: Constify parameter in is_fwnode_irqchip()

2024-06-14 Thread Herve Codina
The fwnode parameter has no reason to be pointer to an un-const struct fwnode_handle. Indeed, struct fwnode_handle is not modified by the function. Be consistent with other function performing the same kind of operation such as is_of_node(), is_acpi_device_node() or is_software_node(): constify th

[PATCH 03/23] irqdomain: Fixed unbalanced fwnode get and put

2024-06-14 Thread Herve Codina
fwnode_handle_get(fwnode) is called when a domain is created with fwnode passed as a function parameter. fwnode_handle_put(domain->fwnode) is called when the domain is destroyed but during the creation a path exists that does not set domain->fwnode. If this path is taken, the fwnode get will never

[PATCH 01/23] irqdomain: Introduce irq_domain_free()

2024-06-14 Thread Herve Codina
In preparation of the introduction of the irq domain instantiation, introduce irq_domain_free() to avoid code duplication on later modifications. This new function is an extraction of the current operations performed to free the irq domain. No functional changes are introduced. Suggested-by: Thom

[PATCH 02/23] irqdomain: Introduce irq_domain_instantiate()

2024-06-14 Thread Herve Codina
The existing irq_domain_add_*() functions used to instantiate an IRQ domain are wrappers built on top of __irq_domain_add() and describes the domain properties using a bunch of parameters. Adding more parameters and wrappers to hide new parameters in the existing code lead to more and more code wi

Re: convert the SCSI ULDs to the atomic queue limits API v2

2024-06-14 Thread Jens Axboe
On Fri, 31 May 2024 09:47:55 +0200, Christoph Hellwig wrote: > this series converts the SCSI upper level drivers to the atomic queue > limits API. > > The first patch is a bug fix for ubd that later patches depend on and > might be worth picking up for 6.10. > > The second patch changes the max

Re: [PATCH 01/14] ubd: refactor the interrupt handler

2024-06-14 Thread Anton Ivanov
On 31/05/2024 08:47, Christoph Hellwig wrote: Instead of a separate handler function that leaves no work in the interrupt hanler itself, split out a per-request end I/O helper and clean up the coding style and variable naming while we're at it. Signed-off-by: Christoph Hellwig Reviewed-by: M

Re: [PATCH 02/14] ubd: untagle discard vs write zeroes not support handling

2024-06-14 Thread Anton Ivanov
On 31/05/2024 08:47, Christoph Hellwig wrote: Discard and Write Zeroes are different operation and implemented by different fallocate opcodes for ubd. If one fails the other one can work and vice versa. Split the code to disable the operations in ubd_handler to only disable the operation tha

Re: [PATCH 10/26] xen-blkfront: don't disable cache flushes when they fail

2024-06-14 Thread Roger Pau Monné
On Thu, Jun 13, 2024 at 04:05:08PM +0200, Christoph Hellwig wrote: > On Wed, Jun 12, 2024 at 05:56:15PM +0200, Roger Pau Monné wrote: > > Right. AFAICT advertising "feature-barrier" and/or > > "feature-flush-cache" could be done based on whether blkback > > understand those commands, not on whethe

Re: [PATCH] um/mm: get max_low_pfn from memblock

2024-06-14 Thread Mike Rapoport
On Fri, Jun 14, 2024 at 09:31:59AM +0200, David Hildenbrand wrote: > On 14.06.24 03:58, Wei Yang wrote: > > Current calculation of max_low_pfn is introduced in commit af84eab20891 > > ("[PATCH] uml: fix LVM crash"). It is intended to set max_low_pfn to the > > same value as max_pfn. > > > > But I

Re: [PATCH] um/mm: get max_low_pfn from memblock

2024-06-14 Thread David Hildenbrand
On 14.06.24 03:58, Wei Yang wrote: Current calculation of max_low_pfn is introduced in commit af84eab20891 ("[PATCH] uml: fix LVM crash"). It is intended to set max_low_pfn to the same value as max_pfn. But I am not sure why the max_pfn is set to totalram_pages, which represents the number of us