how to use gpio
Hi xenomai:
I want to use the RTDM gpio in the Intel Atom(R) x6425RE,the pinctrl driver in the linux kernel is drivers/pinctrl/intel/pinctrl-cherryview.c, I accord to the xenomai code port the GPIO driver(kernel will insmod pinctrl-cherryview.ko),when i insmod the xeno gpio driver, the dmesg log said the irq if no-safe, mybe the irq request in the no-real-time pinctrl-cherryview driver,So if i need port the pinctrl-cherryview driver(let the irq to RTDM irq)?
[54631.293481] irqchip INTC1020:00 is not pipeline-safe! [54631.293489] WARNING: CPU: 0 PID: 2226 at kernel/irq/chip.c:53 irq_set_chip+0x8d/0xb0 [54631.293499] Modules linked in: xeno_gpio_elkhartlake(OE) nls_iso8859_1 snd_hda_codec_hdmi snd_sof_pci_intel_tgl snd_sof_intel_hda_common soundwire_intel soundwire_generic_allocation soundwire_cadence snd_sof_intel_hda snd_sof_pci snd_sof_xtensa_dsp snd_sof snd_soc_hdac_hda snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi soundwire_bus ledtrig_audio snd_soc_core snd_compress ac97_bus snd_pcm_dmaengine snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi snd_hda_codec snd_hda_core snd_hwdep intel_rapl_msr snd_pcm intel_rapl_common x86_pkg_temp_thermal intel_powerclamp snd_seq_midi snd_seq_midi_event coretemp kvm_intel snd_rawmidi kvm crct10dif_pclmul ghash_clmulni_intel mei_hdcp i915 snd_seq aesni_intel binfmt_misc crypto_simd cryptd intel_cstate snd_seq_device intel_wmi_thunderbolt snd_timer wmi_bmof ttm joydev cros_ec_ishtp input_leds drm_kms_helper snd cros_ec cec soundcore rc_core i2c_algo_bit xeno_can fb_sys_fops m_can syscopyarea sysfillrect sysimgblt can_dev mei_me igen6_edac [54631.293566] mei mac_hid acpi_tad sch_fq_codel ramoops msr reed_solomon efi_pstore drm pstore_blk pstore_zone ip_tables x_tables autofs4 hid_logitech_hidpp intel_ishtp_loader intel_ishtp_hid hid_logitech_dj hid_generic usbhid hid intel_ish_ipc crc32_pclmul intel_ishtp i2c_i801 i2c_smbus igc ahci xhci_pci libahci i2c_designware_pci xhci_pci_renesas wmi video pinctrl_elkhartlake [54631.293595] CPU: 0 PID: 2226 Comm: gpiobench Tainted: G U W OE 5.15.51-s1.5-rc.2 #29 [54631.293600] Hardware name: SINSEGYE SX5100/SX5100, BIOS 5.19 11/24/2023 [54631.293601] IRQ stage: Linux [54631.293603] RIP: 0010:irq_set_chip+0x8d/0xb0 [54631.293608] Code: 48 8b 5d f8 c9 c3 80 3d 29 68 a1 01 00 75 ce 48 8b 73 08 48 c7 c7 88 21 80 b3 48 89 45 e0 c6 05 11 68 a1 01 01 e8 19 9c a8 00 <0f> 0b 48 8b 45 e0 eb ab 48 c7 c3 a0 3c b5 b3 eb a2 b8 ea ff ff ff [54631.293610] RSP: 0018:ffffab7e817e3888 EFLAGS: 00010082 [54631.293613] RAX: 0000000000000000 RBX: ffff9a75242482d0 RCX: 0000000000000000 [54631.293615] RDX: 0000000000000002 RSI: 0000000000000027 RDI: 00000000ffffffff [54631.293617] RBP: ffffab7e817e38a8 R08: 0000000000000c42 R09: 00000000b40f4207 [54631.293618] R10: ffffffffffffffff R11: 00000000ffffe415 R12: ffffffffb230b7e0 [54631.293620] R13: 0000000000000000 R14: 000000000000007e R15: ffff9a7538bbca28 [54631.293622] FS: 00007fd40df91b40(0000) GS:ffff9a7570000000(0000) knlGS:0000000000000000 [54631.293624] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [54631.293626] CR2: 00007ffe1a5c9080 CR3: 000000013a8e2000 CR4: 0000000000150eb0 [54631.293628] Call Trace: [54631.293631] <TASK> [54631.293637] irq_set_chip_and_handler_name+0x2e/0x90 [54631.293641] gpiochip_irq_map+0x4d/0xe0 [54631.293647] irq_domain_associate+0x6f/0x190 [54631.293650] irq_create_mapping_affinity+0x12e/0x1a0 [54631.293654] gpiochip_to_irq+0xa2/0xc0 [54631.293658] ? kernfs_add_one+0xdf/0x120 [54631.293661] ? __kernfs_create_file+0x7a/0xc0 [54631.293664] gpiod_to_irq+0x4d/0x80 [54631.293667] gpio_is_visible+0x51/0x70 [54631.293670] internal_create_group+0xdf/0x360 [54631.293673] internal_create_groups+0x48/0xa0 [54631.293676] sysfs_create_groups+0x13/0x20 [54631.293678] device_add+0x707/0x940 [54631.293684] device_create_groups_vargs+0xd7/0x100 [54631.293688] device_create_with_groups+0x3f/0x60 [54631.293692] ? kmem_cache_alloc_trace+0x37a/0x440 [54631.293697] gpiod_export+0x15c/0x2e0 [54631.293700] gpio_pin_ioctl_nrt+0x230/0x380 [54631.293705] rtdm_fd_ioctl+0xc9/0x200 [54631.293709] CoBaLt_ioctl+0xe/0x20 [54631.293712] handle_root_syscall+0xe8/0x320 [54631.293715] ? CoBaLt_fcntl+0x20/0x20 [54631.293718] handle_pipelined_syscall+0x35/0x40 [54631.293723] __pipeline_syscall+0xbe/0x270 [54631.293726] pipeline_syscall+0x57/0xe0 [54631.293728] syscall_enter_from_user_mode+0x39/0xf0 [54631.293733] do_syscall_64+0x36/0xc0 [54631.293736] ? __this_cpu_preempt_check+0x13/0x20 [54631.293739] ? __context_tracking_enter+0x80/0xf0 [54631.293742] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293745] ? do_syscall_64+0x72/0xc0 [54631.293747] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293749] ? do_syscall_64+0x72/0xc0 [54631.293751] ? __this_cpu_preempt_check+0x13/0x20 [54631.293754] ? __context_tracking_enter+0x80/0xf0 [54631.293757] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293760] ? do_syscall_64+0x72/0xc0 [54631.293762] ? exc_page_fault+0x95/0x190 [54631.293764] ? asm_exc_page_fault+0x8/0x30 [54631.293768] entry_SYSCALL_64_after_hwframe+0x44/0xae [54631.293771] RIP: 0033:0x7fd40e1cf16f [54631.293774] Code: 48 8b 04 25 28 00 00 00 48 89 44 24 08 31 c0 48 8d 74 24 04 e8 f2 a6 ff ff b9 50 00 00 10 89 ee 48 63 fb 4c 89 e2 89 c8 0f 05 <8b> 7c 24 04 31 f6 48 89 c3 e8 d3 a6 ff ff 48 8b 4c 24 08 64 48 33 [54631.293777] RSP: 002b:00007ffe1a563c20 EFLAGS: 00000206 ORIG_RAX: 0000000010000050 [54631.293779] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fd40e1cf16f [54631.293781] RDX: 00007ffe1a563cd4 RSI: 0000000040040b02 RDI: 0000000000000004 [54631.293783] RBP: 0000000040040b02 R08: 00007fd40df91b40 R09: 000000000000001d [54631.293784] R10: 000055f7eb7a7229 R11: 0000000000000206 R12: 00007ffe1a563cd4 [54631.293786] R13: 00007ffe1a563cd4 R14: 0000000000000000 R15: 0000000000000000 [54631.293789] </TASK> [54631.293791] ---[ end trace 22748fe0e4a8cba4 ]--- [54631.293862] elkhartlake-pinctrl INTC1020:00: pin 16 cannot be used as IRQ [54631.293865] genirq: Setting trigger mode 3 for irq 126 failed (intel_gpio_irq_type+0x0/0x140)
--------------
Quoted 11 lines
-----Original Message-----
From: [email protected] <[email protected]>
Sent: Wednesday, October 16, 2024 10:20 AM
To: xenomai <[email protected]>
Subject: how to use gpioHi xenomai:
I want to use the RTDM gpio in the Intel Atom(R) x6425RE,the pinctrl driver in the linux kernel isdrivers/pinctrl/intel/pinctrl-cherryview.c, I accord to the
Intel Atom(R) x6425RE is using pinctrl-elkhartlake.c not pinctrl-cherryview.c.
Please refer to corresponding modification on pinctrl-cherryview.c to fix " not pipeline-safe" warning.
Basically , you may need to change corresponding spinlock type from raw spinlock to hard spinlock and set IRQCHIP_PIPELINE_SAFE flag for pinctrl-elkhartlake.c
Regards
Hongzhan Chen
Quoted 129 lines
xenomai code port the GPIO driver(kernel will insmod pinctrl- cherryview.ko),when i insmod the xeno gpio driver, the dmesg log said the irq if no-safe, mybe the irq request in the no-real-time pinctrl-cherryview driver,So if i need port the pinctrl-cherryview driver(let the irq to RTDM irq)?
[54631.293481] irqchip INTC1020:00 is not pipeline-safe! [54631.293489] WARNING: CPU: 0 PID: 2226 at kernel/irq/chip.c:53 irq_set_chip+0x8d/0xb0 [54631.293499] Modules linked in: xeno_gpio_elkhartlake(OE) nls_iso8859_1
snd_hda_codec_hdmisnd_sof_pci_intel_tglsnd_sof_intel_hda_commonsoundwire_intelsoundwire_generic_allocationsoundwire_cadencesnd_sof_intel_hdasnd_sof_pcisnd_sof_xtensa_dspsnd_sofsnd_soc_hdac_hdasnd_hda_ext_coresnd_soc_acpi_intel_matchsnd_soc_acpisoundwire_busledtrig_audiosnd_soc_coresnd_compressac97_bussnd_pcm_dmaenginesnd_hda_intelsnd_intel_dspcfgsnd_intel_sdw_acpisnd_hda_codecsnd_hda_coresnd_hwdepintel_rapl_msrsnd_pcmintel_rapl_commonx86_pkg_temp_thermalintel_powerclampsnd_seq_midisnd_seq_midi_eventcoretempkvm_intelsnd_rawmidikvmcrct10dif_pclmulghash_clmulni_intelmei_hdcpi915snd_seqaesni_intelbinfmt_misccrypto_simdcryptdintel_cstatesnd_seq_deviceintel_wmi_thunderboltsnd_timerwmi_bmofttm joydevcros_ec_ishtpinput_ledsdrm_kms_helpersndcros_eccec soundcorerc_corei2c_algo_bitxeno_canfb_sys_fopsm_cansyscopyarea sysfillrect sysimgbltcan_devmei_meigen6_edac[54631.293566] mei mac_hid acpi_tad sch_fq_codel ramoops msr
reed_solomonefi_pstoredrmpstore_blkpstore_zoneip_tablesx_tablesautofs4hid_logitech_hidppintel_ishtp_loaderintel_ishtp_hidhid_logitech_djhid_genericusbhid hidintel_ish_ipccrc32_pclmulintel_ishtpi2c_i801i2c_smbusigc ahcixhci_pcilibahcii2c_designware_pcixhci_pci_renesaswmi videopinctrl_elkhartlake[54631.293595] CPU: 0 PID: 2226 Comm: gpiobench Tainted: G U W OE 5.15.51-s1.5-rc.2 #29 [54631.293600] Hardware name: SINSEGYE SX5100/SX5100, BIOS 5.19 11/24/2023 [54631.293601] IRQ stage: Linux [54631.293603] RIP: 0010:irq_set_chip+0x8d/0xb0 [54631.293608] Code: 48 8b 5d f8 c9 c3 80 3d 29 68 a1 01 00 75 ce 48 8b 73 08 48 c7 c7 88 21 80 b3 48 89 45 e0 c6 05 11 68 a1 01 01 e8 19 9c a8 00 <0f> 0b 48 8b 45 e0 eb ab 48 c7 c3 a0 3c b5 b3 eb a2 b8 ea ff ff ff [54631.293610] RSP: 0018:ffffab7e817e3888 EFLAGS: 00010082 [54631.293613] RAX: 0000000000000000 RBX: ffff9a75242482d0 RCX: 0000000000000000 [54631.293615] RDX: 0000000000000002 RSI: 0000000000000027 RDI: 00000000ffffffff [54631.293617] RBP: ffffab7e817e38a8 R08: 0000000000000c42 R09: 00000000b40f4207 [54631.293618] R10: ffffffffffffffff R11: 00000000ffffe415 R12: ffffffffb230b7e0 [54631.293620] R13: 0000000000000000 R14: 000000000000007e R15: ffff9a7538bbca28 [54631.293622] FS: 00007fd40df91b40(0000) GS:ffff9a7570000000(0000) knlGS:0000000000000000 [54631.293624] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [54631.293626] CR2: 00007ffe1a5c9080 CR3: 000000013a8e2000 CR4: 0000000000150eb0 [54631.293628] Call Trace: [54631.293631] <TASK> [54631.293637] irq_set_chip_and_handler_name+0x2e/0x90 [54631.293641] gpiochip_irq_map+0x4d/0xe0 [54631.293647] irq_domain_associate+0x6f/0x190 [54631.293650] irq_create_mapping_affinity+0x12e/0x1a0 [54631.293654] gpiochip_to_irq+0xa2/0xc0 [54631.293658] ? kernfs_add_one+0xdf/0x120 [54631.293661] ? __kernfs_create_file+0x7a/0xc0 [54631.293664] gpiod_to_irq+0x4d/0x80 [54631.293667] gpio_is_visible+0x51/0x70 [54631.293670] internal_create_group+0xdf/0x360 [54631.293673] internal_create_groups+0x48/0xa0 [54631.293676] sysfs_create_groups+0x13/0x20 [54631.293678] device_add+0x707/0x940 [54631.293684] device_create_groups_vargs+0xd7/0x100 [54631.293688] device_create_with_groups+0x3f/0x60 [54631.293692] ? kmem_cache_alloc_trace+0x37a/0x440 [54631.293697] gpiod_export+0x15c/0x2e0 [54631.293700] gpio_pin_ioctl_nrt+0x230/0x380 [54631.293705] rtdm_fd_ioctl+0xc9/0x200 [54631.293709] CoBaLt_ioctl+0xe/0x20 [54631.293712] handle_root_syscall+0xe8/0x320 [54631.293715] ? CoBaLt_fcntl+0x20/0x20 [54631.293718] handle_pipelined_syscall+0x35/0x40 [54631.293723] __pipeline_syscall+0xbe/0x270 [54631.293726] pipeline_syscall+0x57/0xe0 [54631.293728] syscall_enter_from_user_mode+0x39/0xf0 [54631.293733] do_syscall_64+0x36/0xc0 [54631.293736] ? __this_cpu_preempt_check+0x13/0x20 [54631.293739] ? __context_tracking_enter+0x80/0xf0 [54631.293742] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293745] ? do_syscall_64+0x72/0xc0 [54631.293747] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293749] ? do_syscall_64+0x72/0xc0 [54631.293751] ? __this_cpu_preempt_check+0x13/0x20 [54631.293754] ? __context_tracking_enter+0x80/0xf0 [54631.293757] ? syscall_exit_to_user_mode+0x52/0x70 [54631.293760] ? do_syscall_64+0x72/0xc0 [54631.293762] ? exc_page_fault+0x95/0x190 [54631.293764] ? asm_exc_page_fault+0x8/0x30 [54631.293768] entry_SYSCALL_64_after_hwframe+0x44/0xae [54631.293771] RIP: 0033:0x7fd40e1cf16f [54631.293774] Code: 48 8b 04 25 28 00 00 00 48 89 44 24 08 31 c0 48 8d 74 24 04 e8 f2 a6 ff ff b9 50 00 00 10 89 ee 48 63 fb 4c 89 e2 89 c8 0f 05 <8b> 7c 24 04 31 f6 48 89 c3 e8 d3 a6 ff ff 48 8b 4c 24 08 64 48 33 [54631.293777] RSP: 002b:00007ffe1a563c20 EFLAGS: 00000206 ORIG_RAX: 0000000010000050 [54631.293779] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fd40e1cf16f [54631.293781] RDX: 00007ffe1a563cd4 RSI: 0000000040040b02 RDI: 0000000000000004 [54631.293783] RBP: 0000000040040b02 R08: 00007fd40df91b40 R09: 000000000000001d [54631.293784] R10: 000055f7eb7a7229 R11: 0000000000000206 R12: 00007ffe1a563cd4 [54631.293786] R13: 00007ffe1a563cd4 R14: 0000000000000000 R15: 0000000000000000 [54631.293789] </TASK> [54631.293791] ---[ end trace 22748fe0e4a8cba4 ]--- [54631.293862] elkhartlake-pinctrl INTC1020:00: pin 16 cannot be used as IRQ [54631.293865] genirq: Setting trigger mode 3 for irq 126 failed(
intel_gpio_irq_type+0x0/0x140)--------------