[PATCH] powerpc/kernel: fix repeated words in comments

2022-11-11 Thread wangjianli
Delete the redundant word 'the'. Signed-off-by: wangjianli --- arch/powerpc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index ab786da8c30b..6fa4ddec6c11 100644 --- a/arch/powerpc/kernel/process

Re: [PATCH v3 0/5] PCI: Remove unnecessary includes

2022-11-11 Thread Rob Herring
On Mon, Oct 31, 2022 at 10:40 AM Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > Many host controller drivers #include even though they > don't need it. Remove the unnecessary #includes. Note that the same is often true of the other of_*.h headers. of_device.h and of_platform.h are tricky th

[PATCH] misc: ocxl: fix possible name leak in ocxl_file_register_afu()

2022-11-11 Thread Yang Yingliang
If device_register() returns error in ocxl_file_register_afu(), the name allocated by dev_set_name() need be freed. As comment of device_register() says, it should use put_device() to give up the reference in the error path. So fix this by calling put_device(), then the name can be freed in kobject

[PATCH 2/2] cxl: fix possible null-ptr-deref in cxl_pci_init_afu|adapter()

2022-11-11 Thread Yang Yingliang
If device_register() fails in cxl_pci_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device. As comment of device_register() says, it should use put_device() to give up the refe

[PATCH 1/2] cxl: fix possible null-ptr-deref in cxl_guest_init_afu|adapter()

2022-11-11 Thread Yang Yingliang
If device_register() fails in cxl_register_afu|adapter(), the device is not added, device_unregister() can not be called in the error path, otherwise it will cause a null-ptr-deref because of removing not added device. As comment of device_register() says, it should use put_device() to give up the

Re: [PATCH printk v3 00/40] reduce console_lock scope

2022-11-11 Thread Mathieu Desnoyers
On 2022-11-07 09:15, John Ogness wrote: [...] The base commit for this series is from Paul McKenney's RCU tree and provides an NMI-safe SRCU implementation [1]. Without the NMI-safe SRCU implementation, this series is not less safe than mainline. But we will need the NMI-safe SRCU implementation

Re: Writing not working to CPLD/FPGA.

2022-11-11 Thread Steven J. Hill
On 11/11/22 02:53, Christophe Leroy wrote: First of all, kernel 3.12 is prehistoric. Have you tried with latest kernel, or at least with one of the long term support releases (see https://www.kernel.org/category/releases.html) ? It is what my customer wants. For this project, upgrading the kern

[patch 32/39] PCI/MSI: Reorder functions in msi.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish There is no way to navigate msi.c without banging the head against the wall every now and then because MSI and MSI-X specific functions are intermingled and the code flow is completely non-obvious. Reorder everthing so common helpers, MSI and MSI-X specific functions are g

[patch 36/39] PCI/MSI: Validate MSIX contiguous restriction early

2022-11-11 Thread Thomas Gleixner
With interrupt domains the sanity check for MSI-X vector validation can be done _before_ any allocation happens. The sanity check only applies to the allocation functions which have an 'entries' array argument. The entries array is filled by the caller with the requested MSI-X indicies. Some driver

[patch 23/39] PCI/MSI: Move pci_alloc_irq_vectors_affinity() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_alloc_irq_vectors_affinity() and let its kernel-doc reference pci_alloc_irq_vectors() documentation added in parent commit. Signed-off-by: Ahmed S. Darwi

[patch 31/39] Documentation: PCI: Add reference to PCI/MSI device driver APIs

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish All exported device-driver MSI APIs are now grouped in one place at drivers/pci/msi/api.c with comprehensive kernel-docs added. Reference these kernel-docs in the official PCI/MSI howto. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- Documentation/

[patch 27/39] PCI/MSI: Move pci_disable_msix() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_disable_msix() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 24 +

[patch 33/39] PCI/MSI: Sanitize MSI-X checks

2022-11-11 Thread Thomas Gleixner
There is no point in doing the same sanity checks over and over in a loop during MSI-X enablement. Put them in front of the loop and return early when they fail. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 67 +- 1 file changed, 34

[patch 18/39] PCI/MSI: Move mask and unmask helpers to msi.h

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish The upcoming support for per device MSI interrupt domains needs to share some of the inline helpers with the MSI implementation. Move them to the header file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c | 61 +--

[patch 19/39] PCI/MSI: Move pci_disable_msi() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish msi.c is a maze of randomly sorted functions which makes the code unreadable. As a first step split the driver visible API and the internal implementation which also allows proper API documentation via one file. Create drivers/pci/msi/api.c to group all exported device-dri

[patch 28/39] PCI/MSI: Move pci_irq_get_affinity() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_irq_get_affinity() and let its kernel-doc match rest of the file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/

[patch 20/39] PCI/MSI: Move pci_enable_msi() API to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_enable_msi() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 23

[patch 25/39] PCI/MSI: Move pci_free_irq_vectors() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_free_irq_vectors() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c |

[patch 24/39] PCI/MSI: Move pci_irq_vector() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_irq_vector() and let its kernel-doc match the rest of the file. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/ap

[patch 34/39] PCI/MSI: Reject multi-MSI early

2022-11-11 Thread Thomas Gleixner
When hierarchical MSI interrupt domains are enabled then there is no point to do tons of work and detect the missing support for multi-MSI late in the allocation path. Just query the domain feature flags right away. The query function is going to be used for other purposes later and has a mode arg

[patch 21/39] PCI/MSI: Move pci_enable_msix_range() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_enable_msix_range() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c |

[patch 30/39] PCI/MSI: Move pci_msi_restore_state() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msi_enabled() and add kernel-doc for the function. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner diff --git a/drivers/pci

[patch 29/39] PCI/MSI: Move pci_msi_enabled() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msi_enabled() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 12 ++

[patch 38/39] genirq/msi: Remove msi_domain_ops::msi_check()

2022-11-11 Thread Thomas Gleixner
No more users. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel/irq/msi.c| 17 + 2 files changed, 1 insertion(+), 20 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -288,7 +288,6 @@ struct msi_domain_info; * @get_hwirq:

[patch 26/39] PCI/MSI: Move pci_msix_vec_count() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Move pci_msix_vec_count() and make its kernel-doc comprehensive. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/api.c | 20

[patch 35/39] PCI/MSI: Reject MSI-X early

2022-11-11 Thread Thomas Gleixner
Similar to PCI multi-MSI reject MSI-X enablement when a irq domain is attached to the device which does not support MSI-X. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c |4 1 file changed, 4 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -760,6 +760

[patch 22/39] PCI/MSI: Move pci_alloc_irq_vectors() to api.c

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish To distangle the maze in msi.c, all exported device-driver MSI APIs are now to be grouped in one file, api.c. Make pci_alloc_irq_vectors() a real function instead of wrapper and add proper kernel doc to it. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner

[patch 17/39] PCI/MSI: Get rid of externs in msi.h

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Follow the style of Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.h |8 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/pci/msi/msi.h +++ b/drivers/pci/msi/msi.h @@ -5,12 +5,12 @@ #define msix_tabl

[patch 37/39] PCI/MSI: Remove redundant msi_check() callback

2022-11-11 Thread Thomas Gleixner
All these sanity checks are now done _before_ any allocation work happens. No point in doing it twice. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 48 1 file changed, 48 deletions(-) --- a/drivers/pci/msi/irqdomain.c +++ b/driv

[patch 02/39] iommu/vt-d: Remove bogus check for multi MSI-X

2022-11-11 Thread Thomas Gleixner
PCI/Multi-MSI is MSI specific and not supported for MSI-X. Signed-off-by: Thomas Gleixner --- drivers/iommu/intel/irq_remapping.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/iommu/intel/irq_remapping.c +++ b/drivers/iommu/intel/irq_remapping.c @@ -1334,8 +1334,7 @@

[patch 16/39] genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN

2022-11-11 Thread Thomas Gleixner
Adjust to reality and remove another layer of pointless Kconfig indirection. CONFIG_GENERIC_MSI_IRQ is good enough to serve all purposes. Signed-off-by: Thomas Gleixner --- drivers/base/Makefile |2 +- drivers/bus/fsl-mc/Kconfig |2 +- drivers/dma/Kconfig |2 +- driver

[patch 10/39] genirq/msi: Make __msi_domain_free_irqs() static

2022-11-11 Thread Thomas Gleixner
Now that the last user is gone, confine it to the core code. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel/irq/msi.c|3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -335,9 +335,6 @@ struct msi_do

[patch 13/39] PCI/MSI: Use msi_domain_info::bus_token

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Set the bus token in the msi_domain_info structure and let the core code handle the update. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) --- a/drivers/

[patch 00/39] genirq, PCI/MSI: Support for per device MSI and PCI/IMS - Part 1 cleanups

2022-11-11 Thread Thomas Gleixner
Hi! This is a three part series which provides support for per device MSI interrupt domains. This solves conceptual problems of the current PCI/MSI design which are in the way of providing support for PCI/MSI[-X] and the upcoming PCI/IMS mechanism on the same device. IMS (Interrupt Message Store]

[patch 05/39] genirq/msi: Remove filter from msi_free_descs_free_range()

2022-11-11 Thread Thomas Gleixner
When a range of descriptors is freed then all of them are not associated to a linux interrupt. Remove the filter and add a warning to the free function. Signed-off-by: Thomas Gleixner --- drivers/base/platform-msi.c |2 +- include/linux/msi.h |5 ++--- kernel/irq/msi.c

[patch 06/39] genirq/msi: Add missing kernel doc to msi_next_desc()

2022-11-11 Thread Thomas Gleixner
W=1 complains about this. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c |1 + 1 file changed, 1 insertion(+) --- a/kernel/irq/msi.c +++ b/kernel/irq/msi.c @@ -282,6 +282,7 @@ EXPORT_SYMBOL_GPL(msi_first_desc); /** * msi_next_desc - Get the next MSI descriptor of a device * @dev:

[patch 11/39] genirq/irqdomain: Move bus token enum into a seperate header

2022-11-11 Thread Thomas Gleixner
Split the bus token defines out into a seperate header file to avoid inclusion of irqdomain.h in msi.h. Signed-off-by: Thomas Gleixner --- include/linux/irqdomain.h | 22 +- include/linux/irqdomain_defs.h | 26 ++ 2 files changed, 27 insertion

[patch 01/39] PCI/MSI: Check for MSI enabled in __pci_msix_enable()

2022-11-11 Thread Thomas Gleixner
PCI/MSI and PCI/MSI-X are mutually exclusive, but the MSI-X enable code lacks a check for already enabled MSI. Signed-off-by: Thomas Gleixner --- drivers/pci/msi/msi.c |5 + 1 file changed, 5 insertions(+) --- a/drivers/pci/msi/msi.c +++ b/drivers/pci/msi/msi.c @@ -935,6 +935,11 @@ stat

[patch 07/39] genirq/msi: Make __msi_domain_alloc_irqs() static

2022-11-11 Thread Thomas Gleixner
Nothing outside of the core code requires this. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |7 ++- kernel/irq/msi.c|6 -- 2 files changed, 6 insertions(+), 7 deletions(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -334,9 +334,8 @@ struct msi_domain_in

[patch 04/39] genirq/msi: Use MSI_DESC_ALL in msi_add_simple_msi_descs()

2022-11-11 Thread Thomas Gleixner
There are no associated MSI descriptors in the requested range when the MSI descriptor allocation fails. Use MSI_DESC_ALL as the filter which prepares the next step to get rid of the filter for freeing. Signed-off-by: Thomas Gleixner --- kernel/irq/msi.c |2 +- 1 file changed, 1 insertion(+)

[patch 14/39] PCI/MSI: Let the MSI core free descriptors

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Let the core do the freeing of descriptors and just keep it around for the legacy case. Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- drivers/pci/msi/irqdomain.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) --- a/drivers/pci/m

[patch 15/39] PCI/MSI: Get rid of PCI_MSI_IRQ_DOMAIN

2022-11-11 Thread Thomas Gleixner
What a zoo: PCI_MSI select GENERIC_MSI_IRQ PCI_MSI_IRQ_DOMAIN def_bool y depends on PCI_MSI select GENERIC_MSI_IRQ_DOMAIN Ergo PCI_MSI enables PCI_MSI_IRQ_DOMAIN which in turn selects GENERIC_MSI_IRQ_DOMAIN. So all the dependencies on PCI_MSI_IRQ_DOMAIN

[patch 09/39] powerpc/pseries/msi: Use msi_domain_ops::msi_post_free()

2022-11-11 Thread Thomas Gleixner
Use the new msi_post_free() callback which is invoked after the interrupts have been freed to tell the hypervisor about the shutdown. This allows to remove the exposure of __msi_domain_free_irqs(). Signed-off-by: Thomas Gleixner Cc: Michael Ellerman Cc: Christophe Leroy Cc: linuxppc-dev@lists.

[patch 08/39] genirq/msi: Provide msi_domain_ops::post_free()

2022-11-11 Thread Thomas Gleixner
To prepare for removing the exposure of __msi_domain_free_irqs() provide a post_free() callback in the MSI domain ops which can be used to solve the problem of the only user of __msi_domain_free_irqs() in arch/powerpc. Signed-off-by: Thomas Gleixner --- include/linux/msi.h |4 kernel/ir

[patch 12/39] genirq/msi: Add bus token to struct msi_domain_info

2022-11-11 Thread Thomas Gleixner
From: Ahmed S. Darwish Add a bus token member to struct msi_domain_info and let msi_create_irq_domain() set the bus token. That allows to remove the bus token updates at the call sites. Suggested-by: Thomas Gleixner Signed-off-by: Ahmed S. Darwish Signed-off-by: Thomas Gleixner --- include/

[patch 03/39] iommu/amd: Remove bogus check for multi MSI-X

2022-11-11 Thread Thomas Gleixner
PCI/Multi-MSI is MSI specific and not supported for MSI-X Signed-off-by: Thomas Gleixner --- drivers/iommu/amd/iommu.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -3294,8 +3294,7 @@ static int irq_remapping_alloc(

[patch 39/39] x86/apic: Remove X86_IRQ_ALLOC_CONTIGUOUS_VECTORS

2022-11-11 Thread Thomas Gleixner
Now that the PCI/MSI core code does early checking for multi-MSI support X86_IRQ_ALLOC_CONTIGUOUS_VECTORS is not required anymore. Remove the flag and rely on MSI_FLAG_MULTI_PCI_MSI. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/irqdomain.h|4 +--- arch/x86/kernel/apic/msi.c

Re: [PATCH v8 0/4] tpm: Preserve TPM measurement log across kexec (ppc64)

2022-11-11 Thread Stefan Berger
On 11/10/22 21:21, Coiby Xu wrote: Hi Michael, Could the PowerPC tree take this patch set which resolves a PowerVM/KVM-specific issue? Michael has (shown me) an alternative approach that protects the already allocated memory to carry it across the kexec. This seems like a good and potenti

Re: [RFC PATCH 0/3] enable bpf_prog_pack allocator for powerpc

2022-11-11 Thread Christophe Leroy
Le 10/11/2022 à 19:43, Hari Bathini a écrit : > Most BPF programs are small, but they consume a page each. For systems > with busy traffic and many BPF programs, this may also add significant > pressure on instruction TLB. High iTLB pressure usually slows down the > whole system causing visible per

Re: [External] [PATCH v5 0/2] arm64: support batched/deferred tlb shootdown during page reclamation

2022-11-11 Thread Punit Agrawal
Yicong Yang writes: > From: Yicong Yang > > Though ARM64 has the hardware to do tlb shootdown, the hardware > broadcasting is not free. > A simplest micro benchmark shows even on snapdragon 888 with only > 8 cores, the overhead for ptep_clear_flush is huge even for paging > out one page mapped b

Re: Writing not working to CPLD/FPGA.

2022-11-11 Thread Christophe Leroy
Hi Steve, Le 11/11/2022 à 01:45, Steven J. Hill a écrit : > Hello. > > My platform is a 7447A with Marvell GT64260 bridge chip. I have currently > got the kernel upgraded to v3.12 (started from v2.6.26) and only have one > more piece to get working that has never worked. There is a CPLD on the >