All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 0/4] Loongarch irq-redirect support
@ 2026-02-02  9:10 Tianyang Zhang
  2026-02-02  9:10 ` [PATCH v10 1/4] Docs/LoongArch: Add Advanced Extended-Redirect IRQ model description Tianyang Zhang
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Tianyang Zhang @ 2026-02-02  9:10 UTC (permalink / raw)
  To: chenhuacai, kernel, corbet, alexs, si.yanteng, tglx, jiaxun.yang,
	maobibo
  Cc: loongarch, linux-doc, linux-kernel, Tianyang Zhang

This series of patches introduces support for interrupt-redirect
controllers, and this hardware feature will be supported on 3C6000
for the first time

change log:
        v0->v1:
        1.Rename the model names in the document.
        2.Adjust the code format.
        3.Remove architecture - specific prefixes.
        4.Refactor the initialization logic, and IR driver no longer set 
	  AVEC_ENABLE.
        5.Enhance compatibility under certain configurations.

        v1->v2:
        1.Fixed an erroneous enabling issue.

        v2->v3
        1.Replace smp_call with address mapping to access registers
        2.Fix some code style issues

        v3->v4
        1.Provide reasonable comments on the modifications made to
	  IRQ_SET_MASK_OK_DONE
        2.Replace meaningless empty functions with parent_mask/unmask/ack
        3.Added and indeed released resources
        4.Added judgment for data structure initialization completion to 
          avoid duplicate creation during cpuhotplug
        5.Fixed the code style and some unnecessary troubles

        v4->v5
	1.when it is detected in avecintc_set_affinity that the current affinity
	remains valid, the return value is modified to IRQ_SET_MASK_OK_DONE.
	  After the introduction of redirect-domain, for each interrupt source, 
	avecintc-domain only provides the CPU/interrupt vector, while redirect-domain 
	provides other operations to synchronize interrupt affinity information 
	among multiple cores. 	  The original intention is to notify the cascaded
	redirect_set_affinity that multi-core synchronization is not required. 
	  However, this introduces some compatibility issues, such as the new return
	value causing msi_domain_set_affinity to no longer perform irq_chip_write_msi_msg.
	  1) When redirect exist in the system, the msi msg_address and msg_data no 
	longer changes after the allocation phase, so it does not actually require updating
	the MSI message info.
	  2) When only avecintc exists in the system, the irq_domain_activate_irq
	interface will be responsible for the initial configuration of the MSI message,
	which is unconditional. After that, if unnecessary, no modification to the MSI
	message is alse correctly.

	2.Restructured the macro definitions to make them appear more logical.

	3.Adjusted the layout of members struct redirect_queue\struct redirect_table and 
	struct redirect_item, making redirect_item the primary interface for accessing
	other members.

	4.The method of accessing registers has been standardized to MMIO.

	5.Initialize variables at declaration whenever possible.

	6.Replaced the the "struct page" in redirect_table and redirect_queue with "struct folio".

	7.Adjusted the initialization process so that all irq_desc configurations are completed
	during driver initialization, no longer relying on specific CPUs being online.

	8.Refactored portions of the code to make them more concise and logical.

	v5->v6
	Fix the warning messages reported by the test bot.

	v6->v7:
	1 Split patch:
 	 1) Docs/LoongArch: Add Advanced Extended-Redirect IRQ model description
	 2) LoongArch: Architectural preparation for Redirect irqchip
	 3) irqchip/irq-loongson.h:irq-loongson.h preparation for Redirect irqchip
	 4) irqchip/loongarch-avec.c:return IRQ_SET_MASK_OK_DONE when keep affinity
	 5) irqchip/irq-loongarch-ir:Add Redirect irqchip support

	2 Use sizeof() to replace fixed-size macro definitions.

	3 Unify the data types of the parameters for redirect_write/read_reg*.

	4 rename irde_invalid_entry_node to irde_invalid_entry and add comments 
	  explaining the 'raddr'.

	5 Fix the critical condition check bug in redirect_table_alloc.

	6 Use clear_bit to replace bitmap_release_region

	7 Delete some goto and handle the failure when it occurs.

	8 Removed the check for the `CONFIG_ACPI` macro, as CONFIG_ACPI 
          is selected by the arch/loongarch/Kconfig.

	9 Fixed the incorrect error flow in redirect_acpi_init.

	v7->v8:
	1 Apologies for the chaotic email delivery due to some network issues earlier.

	2 redirect_table_alloc now allocates nr_irqs consecutive redirect table entries to 
	  support multiple MSI devices.

	v8->v9:
	1 Rebased and reorganized the patches on the latest irq/core branch.

	v9->v10
	1 Rewrite the changelog in the order of background, problem and solution.
	2 Fix the potential undefined issue with 'order' in the redirect_table_alloc.
	3 Use GPL-2.0-only as SPDX-License-Identifier.
	4 Update the code creation time.
	5 Rearrange the order of the header files alphabetically.
	6 Refactor portions of the code and remove unnecessary line breaks.
	7 Rename __redirect_irde_fini() to redirect_free_irde() and label it with __init.

Tianyang Zhang (4):
  Docs/LoongArch: Add Advanced Extended-Redirect IRQ model description
  irqchip/irq-loongson.h: irq-loongson.h preparation for Redirect
    irqchip
  irqchip/loongarch-avec.c: return IRQ_SET_MASK_OK_DONE when keep
    affinity
  irqchip/irq-loongarch-ir:Add Redirect irqchip support

 .../arch/loongarch/irq-chip-model.rst         |  38 ++
 .../zh_CN/arch/loongarch/irq-chip-model.rst   |  37 ++
 drivers/irqchip/Makefile                      |   2 +-
 drivers/irqchip/irq-loongarch-avec.c          |  20 +-
 drivers/irqchip/irq-loongarch-ir.c            | 523 ++++++++++++++++++
 drivers/irqchip/irq-loongson.h                |  19 +
 6 files changed, 625 insertions(+), 14 deletions(-)
 create mode 100644 drivers/irqchip/irq-loongarch-ir.c

-- 
2.41.0


^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [PATCH v10 4/4] irqchip/irq-loongarch-ir:Add Redirect irqchip support
@ 2026-02-02 21:58 kernel test robot
  0 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2026-02-02 21:58 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: drivers/irqchip/irq-loongarch-ir.c:206:21: sparse: sparse: unsigned value that used to be signed checked against zero?"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260202091041.2278271-5-zhangtianyang@loongson.cn>
References: <20260202091041.2278271-5-zhangtianyang@loongson.cn>
TO: Tianyang Zhang <zhangtianyang@loongson.cn>
TO: chenhuacai@kernel.org
TO: kernel@xen0n.name
TO: corbet@lwn.net
TO: alexs@kernel.org
TO: si.yanteng@linux.dev
TO: tglx@linutronix.de
TO: jiaxun.yang@flygoat.com
TO: maobibo@loongson.cn
CC: loongarch@lists.linux.dev
CC: linux-doc@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Tianyang Zhang <zhangtianyang@loongson.cn>
CC: Liupu Wang <wangliupu@loongson.cn>

Hi Tianyang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on linus/master v6.19-rc8 next-20260202]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Tianyang-Zhang/Docs-LoongArch-Add-Advanced-Extended-Redirect-IRQ-model-description/20260202-171607
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/20260202091041.2278271-5-zhangtianyang%40loongson.cn
patch subject: [PATCH v10 4/4] irqchip/irq-loongarch-ir:Add Redirect irqchip support
:::::: branch date: 13 hours ago
:::::: commit date: 13 hours ago
config: loongarch-randconfig-r111-20260202 (https://download.01.org/0day-ci/archive/20260203/202602030502.rQEjzv5G-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
rustc: rustc 1.88.0 (6b00bc388 2025-06-23)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260203/202602030502.rQEjzv5G-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202602030502.rQEjzv5G-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   drivers/irqchip/irq-loongarch-ir.c:159:9: sparse: sparse: context imbalance in 'invalid_enqueue' - wrong count at exit
>> drivers/irqchip/irq-loongarch-ir.c:206:21: sparse: sparse: unsigned value that used to be signed checked against zero?
   drivers/irqchip/irq-loongarch-ir.c: note: in included file (through include/linux/cpumask.h, arch/loongarch/include/asm/processor.h, arch/loongarch/include/asm/thread_info.h, ...):
   include/linux/bitmap.h:718:32: sparse: signed value source
   include/linux/bitmap.h:712:5: sparse: sparse: context imbalance in 'redirect_table_alloc' - wrong count at exit

vim +206 drivers/irqchip/irq-loongarch-ir.c

dbaee479dc4803 Tianyang Zhang 2026-02-02  192  
dbaee479dc4803 Tianyang Zhang 2026-02-02  193  static int redirect_table_alloc(int node, u32 nr_irqs)
dbaee479dc4803 Tianyang Zhang 2026-02-02  194  {
dbaee479dc4803 Tianyang Zhang 2026-02-02  195  	struct redirect_table *ird_table = &irde_descs[node].ird_table;
dbaee479dc4803 Tianyang Zhang 2026-02-02  196  	unsigned int index, order = 0;
dbaee479dc4803 Tianyang Zhang 2026-02-02  197  
dbaee479dc4803 Tianyang Zhang 2026-02-02  198  	if (nr_irqs > 1) {
dbaee479dc4803 Tianyang Zhang 2026-02-02  199  		nr_irqs = __roundup_pow_of_two(nr_irqs);
dbaee479dc4803 Tianyang Zhang 2026-02-02  200  		order = ilog2(nr_irqs);
dbaee479dc4803 Tianyang Zhang 2026-02-02  201  	}
dbaee479dc4803 Tianyang Zhang 2026-02-02  202  
dbaee479dc4803 Tianyang Zhang 2026-02-02  203  	guard(raw_spinlock_irqsave)(&ird_table->lock);
dbaee479dc4803 Tianyang Zhang 2026-02-02  204  
dbaee479dc4803 Tianyang Zhang 2026-02-02  205  	index = bitmap_find_free_region(ird_table->bitmap, IRD_ENTRIES, order);
dbaee479dc4803 Tianyang Zhang 2026-02-02 @206  	if (index < 0) {
dbaee479dc4803 Tianyang Zhang 2026-02-02  207  		pr_err("No redirect entry to use\n");
dbaee479dc4803 Tianyang Zhang 2026-02-02  208  		return -EINVAL;
dbaee479dc4803 Tianyang Zhang 2026-02-02  209  	}
dbaee479dc4803 Tianyang Zhang 2026-02-02  210  
dbaee479dc4803 Tianyang Zhang 2026-02-02  211  	return index;
dbaee479dc4803 Tianyang Zhang 2026-02-02  212  }
dbaee479dc4803 Tianyang Zhang 2026-02-02  213  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-02-03  9:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-02  9:10 [PATCH v10 0/4] Loongarch irq-redirect support Tianyang Zhang
2026-02-02  9:10 ` [PATCH v10 1/4] Docs/LoongArch: Add Advanced Extended-Redirect IRQ model description Tianyang Zhang
2026-02-02  9:10 ` [PATCH v10 2/4] irqchip/irq-loongson.h: irq-loongson.h preparation for Redirect irqchip Tianyang Zhang
2026-02-02  9:59   ` Thomas Gleixner
2026-02-03  1:25     ` Tianyang Zhang
2026-02-02  9:10 ` [PATCH v10 3/4] irqchip/loongarch-avec.c: return IRQ_SET_MASK_OK_DONE when keep affinity Tianyang Zhang
2026-02-02  9:10 ` [PATCH v10 4/4] irqchip/irq-loongarch-ir:Add Redirect irqchip support Tianyang Zhang
2026-02-02 10:07   ` Thomas Gleixner
2026-02-03  1:33     ` Tianyang Zhang
2026-02-03  9:18   ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-02-02 21:58 kernel test robot

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.