lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250828103357000A2MUuzw_xx2PHM0W4Y74K@zte.com.cn>
Date: Thu, 28 Aug 2025 10:33:57 +0800 (CST)
From: <liu.xuemei1@....com.cn>
To: <mani@...nel.org>, <kwilczynski@...nel.org>, <kishon@...nel.org>,
        <bhelgaas@...gle.com>, <lpieralisi@...nel.org>
Cc: <liu.song13@....com.cn>, <linux-pci@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] PCI: endpoint: Avoid creating sub-groups asynchronously

>On Thu, Jul 10, 2025 at 02:38:45PM GMT, liu.xuemei1@....com.cn wrote:
>> From: Liu Song <liu.song13@....com.cn>
>>
>> The asynchronous creation of sub-groups by a delayed work could lead to an
>> null-pointer-dereference exception when the driver directory gets
>> removed before the work completes.
>>
>> The crash can be easily reproduced with the following commands.
>>
>>  # mkdir test && rmdir test
>>
>
>Could you please share more info on repro? Where did you execute above commands?
>I see that you used QEMU, so I'm curious to repro the issue.

Sorry for the ambiguousness, the complete reproducer will be like:

# modprobe pci_epf_test
# cd /sys/kernel/config/pci_ep/functions/pci_epf_test
# mkdir test && rmdir test # repeated

I found this problem in testing an out-of-tree pci_epf driver in kernel 6.6. The
problem can be reproduced without a hardware, so I tested it with the newest
kernel in a VM.

>
>- Mani
>
>> Fixes this by using configfs_add_default_group() which does not have the
>> deadlock problem as configfs_register_group().
>>
>> Backtraces of the crash:
>>  BUG: kernel NULL pointer dereference, address: 0000000000000088
>>  #PF: supervisor write access in kernel mode
>>  #PF: error_code(0x0002) - not-present page
>>  PGD 0
>>  Oops: Oops: 0002 [#1] SMP NOPTI
>>  CPU: 4 UID: 0 PID: 371 Comm: kworker/4:1 Kdump: loaded Tainted: G            E       6.16.0-rc3 #2 PREEMPT(lazy)
>>  Tainted: [E]=UNSIGNED_MODULE
>>  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
>>  Workqueue: events pci_epf_cfs_work
>>  RIP: 0010:mutex_lock+0x1c/0x30
>>  Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 0f 1f 44 00 00 53 48 89 fb 2e 2e 2e 31 c0 65 48 8b 15 5e 4c 29 02 31 c0 <f0> 48 0f b1 13 75 06 5b e9 97 8a 00 00 48 89 df 5b eb b1 90 90 90
>>  RSP: 0018:ff64babb4111fdf0 EFLAGS: 00010246
>>  RAX: 0000000000000000 RBX: 0000000000000088 RCX: 0000000000000000
>>  RDX: ff2de9c80f5d3080 RSI: ffffffffb9e58559 RDI: 0000000000000088
>>  RBP: ff2de9c8269df9c0 R08: 0000000000000040 R09: 0000000000000000
>>  R10: ff64babb4111fdf0 R11: 00000000ffffffff R12: ff2de9c80f753e88
>>  R13: ff2de9c80f753e00 R14: 0000000000000000 R15: ff2de9c80f753f98
>>  FS:  0000000000000000(0000) GS:ff2de9d78069f000(0000) knlGS:0000000000000000
>>  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>  CR2: 0000000000000088 CR3: 0000000ac782c003 CR4: 0000000000773ef0
>>  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
>>  DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
>>  PKRU: 55555554
>>  Call Trace:
>>   <TASK>
>>   configfs_register_group+0x3d/0x190
>>   pci_epf_cfs_work+0x41/0x110
>>   process_one_work+0x18f/0x350
>>   worker_thread+0x25a/0x3a0
>>   ? __pfx_worker_thread+0x10/0x10
>>   kthread+0xfc/0x240
>>   ? __pfx_kthread+0x10/0x10
>>   ? __pfx_kthread+0x10/0x10
>>   ret_from_fork+0x14f/0x180
>>   ? __pfx_kthread+0x10/0x10
>>   ret_from_fork_asm+0x1a/0x30
>>   </TASK>
>>  Modules linked in: pci_epf_test(E) nft_fib_inet(E) nft_fib_ipv4(E) nft_fib_ipv6(E) nft_fib(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nft_chain_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) rfkill(E) ip_set(E) nf_tables(E) intel_rapl_msr(E) intel_rapl_common(E) intel_uncore_frequency_common(E) qrtr(E) isst_if_common(E) skx_edac_common(E) nfit(E) libnvdimm(E) sunrpc(E) kvm_intel(E) vfat(E) fat(E) kvm(E) irqbypass(E) rapl(E) iTCO_wdt(E) 8139too(E) intel_pmc_bxt(E) iTCO_vendor_support(E) 8139cp(E) virtio_gpu(E) mii(E) virtio_input(E) virtio_dma_buf(E) i2c_i801(E) pcspkr(E) lpc_ich(E) i2c_smbus(E) virtio_balloon(E) joydev(E) loop(E) dm_multipath(E) nfnetlink(E) vsock_loopback(E) vmw_vsock_virtio_transport_common(E) vmw_vsock_vmci_transport(E) vsock(E) zram(E) lz4hc_compress(E) vmw_vmci(E) lz4_compress(E) xfs(E) polyval_clmulni(E) ghash_clmulni_intel(E) sha512_ssse3(E) sha1_ssse3(E) serio_raw(E) scsi_dh_rdac(E) scsi_dh_emc(E)
>>  scsi_dh_alua(E) fuse(E)
>>   qemu_fw_cfg(E)
>>  Unloaded tainted modules: intel_uncore_frequency(E):1 i10nm_edac(E):1 intel_cstate(E):1 intel_uncore(E):1 hv_vmbus(E):1
>>  CR2: 0000000000000088
>>  ---[ end trace 0000000000000000 ]---
>>
>> Fixes: e85a2d783762 ("PCI: endpoint: Add support in configfs to associate two EPCs with EPF")
>> Signed-off-by: Liu Song <liu.song13@....com.cn>
>> ---
>>  drivers/pci/endpoint/pci-ep-cfs.c | 15 +++++----------
>>  1 file changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
>> index ef50c82e647f..43feb6139fa3 100644
>> --- a/drivers/pci/endpoint/pci-ep-cfs.c
>> +++ b/drivers/pci/endpoint/pci-ep-cfs.c
>> @@ -23,7 +23,6 @@ struct pci_epf_group {
>>      struct config_group group;
>>      struct config_group primary_epc_group;
>>      struct config_group secondary_epc_group;
>> -    struct delayed_work cfs_work;
>>      struct pci_epf *epf;
>>      int index;
>>  };
>> @@ -103,7 +102,7 @@ static struct config_group
>>      secondary_epc_group = &epf_group->secondary_epc_group;
>>      config_group_init_type_name(secondary_epc_group, "secondary",
>>                      &pci_secondary_epc_type);
>> -    configfs_register_group(&epf_group->group, secondary_epc_group);
>> +    configfs_add_default_group(secondary_epc_group, &epf_group->group);
>>
>>      return secondary_epc_group;
>>  }
>> @@ -166,7 +165,7 @@ static struct config_group
>>
>>      config_group_init_type_name(primary_epc_group, "primary",
>>                      &pci_primary_epc_type);
>> -    configfs_register_group(&epf_group->group, primary_epc_group);
>> +    configfs_add_default_group(primary_epc_group, &epf_group->group);
>>
>>      return primary_epc_group;
>>  }
>> @@ -570,15 +569,13 @@ static void pci_ep_cfs_add_type_group(struct pci_epf_group *epf_group)
>>          return;
>>      }
>>
>> -    configfs_register_group(&epf_group->group, group);
>> +    configfs_add_default_group(group, &epf_group->group);
>>  }
>>
>> -static void pci_epf_cfs_work(struct work_struct *work)
>> +static void pci_epf_cfs_add_sub_groups(struct pci_epf_group *epf_group)
>>  {
>> -    struct pci_epf_group *epf_group;
>>      struct config_group *group;
>>
>> -    epf_group = container_of(work, struct pci_epf_group, cfs_work.work);
>>      group = pci_ep_cfs_add_primary_group(epf_group);
>>      if (IS_ERR(group)) {
>>          pr_err("failed to create 'primary' EPC interface\n");
>> @@ -637,9 +634,7 @@ static struct config_group *pci_epf_make(struct config_group *group,
>>
>>      kfree(epf_name);
>>
>> -    INIT_DELAYED_WORK(&epf_group->cfs_work, pci_epf_cfs_work);
>> -    queue_delayed_work(system_wq, &epf_group->cfs_work,
>> -               msecs_to_jiffies(1));
>> +    pci_epf_cfs_add_sub_groups(epf_group);
>>
>>      return &epf_group->group;
>>
>> --
>> 2.27.0
>
>--
>மணிவண்ணன் சதாசிவம்
<div class="zcontentRow"><div><div><div class="control-group zhistoryPanel"><div class="zhistoryContent">&gt;On&nbsp;Thu,&nbsp;Jul&nbsp;10,&nbsp;2025&nbsp;at&nbsp;02:38:45PM&nbsp;GMT,&nbsp;liu.xuemei1@....com.cn&nbsp;wrote:<br>&gt;&gt;&nbsp;From:&nbsp;Liu&nbsp;Song&nbsp;&lt;liu.song13@....com.cn&gt;<br>&gt;&gt;<br>&gt;&gt;&nbsp;The&nbsp;asynchronous&nbsp;creation&nbsp;of&nbsp;sub-groups&nbsp;by&nbsp;a&nbsp;delayed&nbsp;work&nbsp;could&nbsp;lead&nbsp;to&nbsp;an<br>&gt;&gt;&nbsp;null-pointer-dereference&nbsp;exception&nbsp;when&nbsp;the&nbsp;driver&nbsp;directory&nbsp;gets<br>&gt;&gt;&nbsp;removed&nbsp;before&nbsp;the&nbsp;work&nbsp;completes.<br>&gt;&gt;<br>&gt;&gt;&nbsp;The&nbsp;crash&nbsp;can&nbsp;be&nbsp;easily&nbsp;reproduced&nbsp;with&nbsp;the&nbsp;following&nbsp;commands.<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;#&nbsp;mkdir&nbsp;test&nbsp;&amp;&amp;&nbsp;rmdir&nbsp;test<br>&gt;&gt;<br>&gt;<br>&gt;Could&nbsp;you&nbsp;please&nbsp;share&nbsp;more&nbsp;info&nbsp;on&nbsp;repro?&nbsp;Where&nbsp;did&nbsp;you&nbsp;execute&nbsp;above&nbsp;commands?<br>&gt;I&nbsp;see&nbsp;that&nbsp;you&nbsp;used&nbsp;QEMU,&nbsp;so&nbsp;I'm&nbsp;curious&nbsp;to&nbsp;repro&nbsp;the&nbsp;issue.<br><br>Sorry&nbsp;for&nbsp;the&nbsp;ambiguousness,&nbsp;the&nbsp;complete&nbsp;reproducer&nbsp;will&nbsp;be&nbsp;like:<br><br>#&nbsp;modprobe&nbsp;pci_epf_test<br>#&nbsp;cd&nbsp;/sys/kernel/config/pci_ep/functions/pci_epf_test<br>#&nbsp;mkdir&nbsp;test&nbsp;&amp;&amp;&nbsp;rmdir&nbsp;test&nbsp;#&nbsp;repeated<br><br>I&nbsp;found&nbsp;this&nbsp;problem&nbsp;in&nbsp;testing&nbsp;an&nbsp;out-of-tree&nbsp;pci_epf&nbsp;driver&nbsp;in&nbsp;kernel&nbsp;6.6.&nbsp;The<br>problem&nbsp;can&nbsp;be&nbsp;reproduced&nbsp;without&nbsp;a&nbsp;hardware,&nbsp;so&nbsp;I&nbsp;tested&nbsp;it&nbsp;with&nbsp;the&nbsp;newest<br>kernel&nbsp;in&nbsp;a&nbsp;VM.<br><br>&gt;<br>&gt;-&nbsp;Mani<br>&gt;<br>&gt;&gt;&nbsp;Fixes&nbsp;this&nbsp;by&nbsp;using&nbsp;configfs_add_default_group()&nbsp;which&nbsp;does&nbsp;not&nbsp;have&nbsp;the<br>&gt;&gt;&nbsp;deadlock&nbsp;problem&nbsp;as&nbsp;configfs_register_group().<br>&gt;&gt;<br>&gt;&gt;&nbsp;Backtraces&nbsp;of&nbsp;the&nbsp;crash:<br>&gt;&gt;&nbsp;&nbsp;BUG:&nbsp;kernel&nbsp;NULL&nbsp;pointer&nbsp;dereference,&nbsp;address:&nbsp;0000000000000088<br>&gt;&gt;&nbsp;&nbsp;#PF:&nbsp;supervisor&nbsp;write&nbsp;access&nbsp;in&nbsp;kernel&nbsp;mode<br>&gt;&gt;&nbsp;&nbsp;#PF:&nbsp;error_code(0x0002)&nbsp;-&nbsp;not-present&nbsp;page<br>&gt;&gt;&nbsp;&nbsp;PGD&nbsp;0<br>&gt;&gt;&nbsp;&nbsp;Oops:&nbsp;Oops:&nbsp;0002&nbsp;[#1]&nbsp;SMP&nbsp;NOPTI<br>&gt;&gt;&nbsp;&nbsp;CPU:&nbsp;4&nbsp;UID:&nbsp;0&nbsp;PID:&nbsp;371&nbsp;Comm:&nbsp;kworker/4:1&nbsp;Kdump:&nbsp;loaded&nbsp;Tainted:&nbsp;G&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.16.0-rc3&nbsp;#2&nbsp;PREEMPT(lazy)<br>&gt;&gt;&nbsp;&nbsp;Tainted:&nbsp;[E]=UNSIGNED_MODULE<br>&gt;&gt;&nbsp;&nbsp;Hardware&nbsp;name:&nbsp;QEMU&nbsp;Standard&nbsp;PC&nbsp;(Q35&nbsp;+&nbsp;ICH9,&nbsp;2009),&nbsp;BIOS&nbsp;0.0.0&nbsp;02/06/2015<br>&gt;&gt;&nbsp;&nbsp;Workqueue:&nbsp;events&nbsp;pci_epf_cfs_work<br>&gt;&gt;&nbsp;&nbsp;RIP:&nbsp;0010:mutex_lock+0x1c/0x30<br>&gt;&gt;&nbsp;&nbsp;Code:&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;90&nbsp;f3&nbsp;0f&nbsp;1e&nbsp;fa&nbsp;0f&nbsp;1f&nbsp;44&nbsp;00&nbsp;00&nbsp;53&nbsp;48&nbsp;89&nbsp;fb&nbsp;2e&nbsp;2e&nbsp;2e&nbsp;31&nbsp;c0&nbsp;65&nbsp;48&nbsp;8b&nbsp;15&nbsp;5e&nbsp;4c&nbsp;29&nbsp;02&nbsp;31&nbsp;c0&nbsp;&lt;f0&gt;&nbsp;48&nbsp;0f&nbsp;b1&nbsp;13&nbsp;75&nbsp;06&nbsp;5b&nbsp;e9&nbsp;97&nbsp;8a&nbsp;00&nbsp;00&nbsp;48&nbsp;89&nbsp;df&nbsp;5b&nbsp;eb&nbsp;b1&nbsp;90&nbsp;90&nbsp;90<br>&gt;&gt;&nbsp;&nbsp;RSP:&nbsp;0018:ff64babb4111fdf0&nbsp;EFLAGS:&nbsp;00010246<br>&gt;&gt;&nbsp;&nbsp;RAX:&nbsp;0000000000000000&nbsp;RBX:&nbsp;0000000000000088&nbsp;RCX:&nbsp;0000000000000000<br>&gt;&gt;&nbsp;&nbsp;RDX:&nbsp;ff2de9c80f5d3080&nbsp;RSI:&nbsp;ffffffffb9e58559&nbsp;RDI:&nbsp;0000000000000088<br>&gt;&gt;&nbsp;&nbsp;RBP:&nbsp;ff2de9c8269df9c0&nbsp;R08:&nbsp;0000000000000040&nbsp;R09:&nbsp;0000000000000000<br>&gt;&gt;&nbsp;&nbsp;R10:&nbsp;ff64babb4111fdf0&nbsp;R11:&nbsp;00000000ffffffff&nbsp;R12:&nbsp;ff2de9c80f753e88<br>&gt;&gt;&nbsp;&nbsp;R13:&nbsp;ff2de9c80f753e00&nbsp;R14:&nbsp;0000000000000000&nbsp;R15:&nbsp;ff2de9c80f753f98<br>&gt;&gt;&nbsp;&nbsp;FS:&nbsp;&nbsp;0000000000000000(0000)&nbsp;GS:ff2de9d78069f000(0000)&nbsp;knlGS:0000000000000000<br>&gt;&gt;&nbsp;&nbsp;CS:&nbsp;&nbsp;0010&nbsp;DS:&nbsp;0000&nbsp;ES:&nbsp;0000&nbsp;CR0:&nbsp;0000000080050033<br>&gt;&gt;&nbsp;&nbsp;CR2:&nbsp;0000000000000088&nbsp;CR3:&nbsp;0000000ac782c003&nbsp;CR4:&nbsp;0000000000773ef0<br>&gt;&gt;&nbsp;&nbsp;DR0:&nbsp;0000000000000000&nbsp;DR1:&nbsp;0000000000000000&nbsp;DR2:&nbsp;0000000000000000<br>&gt;&gt;&nbsp;&nbsp;DR3:&nbsp;0000000000000000&nbsp;DR6:&nbsp;00000000fffe0ff0&nbsp;DR7:&nbsp;0000000000000400<br>&gt;&gt;&nbsp;&nbsp;PKRU:&nbsp;55555554<br>&gt;&gt;&nbsp;&nbsp;Call&nbsp;Trace:<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&lt;TASK&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;configfs_register_group+0x3d/0x190<br>&gt;&gt;&nbsp;&nbsp;&nbsp;pci_epf_cfs_work+0x41/0x110<br>&gt;&gt;&nbsp;&nbsp;&nbsp;process_one_work+0x18f/0x350<br>&gt;&gt;&nbsp;&nbsp;&nbsp;worker_thread+0x25a/0x3a0<br>&gt;&gt;&nbsp;&nbsp;&nbsp;?&nbsp;__pfx_worker_thread+0x10/0x10<br>&gt;&gt;&nbsp;&nbsp;&nbsp;kthread+0xfc/0x240<br>&gt;&gt;&nbsp;&nbsp;&nbsp;?&nbsp;__pfx_kthread+0x10/0x10<br>&gt;&gt;&nbsp;&nbsp;&nbsp;?&nbsp;__pfx_kthread+0x10/0x10<br>&gt;&gt;&nbsp;&nbsp;&nbsp;ret_from_fork+0x14f/0x180<br>&gt;&gt;&nbsp;&nbsp;&nbsp;?&nbsp;__pfx_kthread+0x10/0x10<br>&gt;&gt;&nbsp;&nbsp;&nbsp;ret_from_fork_asm+0x1a/0x30<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&lt;/TASK&gt;<br>&gt;&gt;&nbsp;&nbsp;Modules&nbsp;linked&nbsp;in:&nbsp;pci_epf_test(E)&nbsp;nft_fib_inet(E)&nbsp;nft_fib_ipv4(E)&nbsp;nft_fib_ipv6(E)&nbsp;nft_fib(E)&nbsp;nft_reject_inet(E)&nbsp;nf_reject_ipv4(E)&nbsp;nf_reject_ipv6(E)&nbsp;nft_reject(E)&nbsp;nft_ct(E)&nbsp;nft_chain_nat(E)&nbsp;nf_nat(E)&nbsp;nf_conntrack(E)&nbsp;nf_defrag_ipv6(E)&nbsp;nf_defrag_ipv4(E)&nbsp;rfkill(E)&nbsp;ip_set(E)&nbsp;nf_tables(E)&nbsp;intel_rapl_msr(E)&nbsp;intel_rapl_common(E)&nbsp;intel_uncore_frequency_common(E)&nbsp;qrtr(E)&nbsp;isst_if_common(E)&nbsp;skx_edac_common(E)&nbsp;nfit(E)&nbsp;libnvdimm(E)&nbsp;sunrpc(E)&nbsp;kvm_intel(E)&nbsp;vfat(E)&nbsp;fat(E)&nbsp;kvm(E)&nbsp;irqbypass(E)&nbsp;rapl(E)&nbsp;iTCO_wdt(E)&nbsp;8139too(E)&nbsp;intel_pmc_bxt(E)&nbsp;iTCO_vendor_support(E)&nbsp;8139cp(E)&nbsp;virtio_gpu(E)&nbsp;mii(E)&nbsp;virtio_input(E)&nbsp;virtio_dma_buf(E)&nbsp;i2c_i801(E)&nbsp;pcspkr(E)&nbsp;lpc_ich(E)&nbsp;i2c_smbus(E)&nbsp;virtio_balloon(E)&nbsp;joydev(E)&nbsp;loop(E)&nbsp;dm_multipath(E)&nbsp;nfnetlink(E)&nbsp;vsock_loopback(E)&nbsp;vmw_vsock_virtio_transport_common(E)&nbsp;vmw_vsock_vmci_transport(E)&nbsp;vsock(E)&nbsp;zram(E)&nbsp;lz4hc_compress(E)&nbsp;vmw_vmci(E)&nbsp;lz4_compress(E)&nbsp;xfs(E)&nbsp;polyval_clmulni(E)&nbsp;ghash_clmulni_intel(E)&nbsp;sha512_ssse3(E)&nbsp;sha1_ssse3(E)&nbsp;serio_raw(E)&nbsp;scsi_dh_rdac(E)&nbsp;scsi_dh_emc(E)<br>&gt;&gt;&nbsp;&nbsp;scsi_dh_alua(E)&nbsp;fuse(E)<br>&gt;&gt;&nbsp;&nbsp;&nbsp;qemu_fw_cfg(E)<br>&gt;&gt;&nbsp;&nbsp;Unloaded&nbsp;tainted&nbsp;modules:&nbsp;intel_uncore_frequency(E):1&nbsp;i10nm_edac(E):1&nbsp;intel_cstate(E):1&nbsp;intel_uncore(E):1&nbsp;hv_vmbus(E):1<br>&gt;&gt;&nbsp;&nbsp;CR2:&nbsp;0000000000000088<br>&gt;&gt;&nbsp;&nbsp;---[&nbsp;end&nbsp;trace&nbsp;0000000000000000&nbsp;]---<br>&gt;&gt;<br>&gt;&gt;&nbsp;Fixes:&nbsp;e85a2d783762&nbsp;("PCI:&nbsp;endpoint:&nbsp;Add&nbsp;support&nbsp;in&nbsp;configfs&nbsp;to&nbsp;associate&nbsp;two&nbsp;EPCs&nbsp;with&nbsp;EPF")<br>&gt;&gt;&nbsp;Signed-off-by:&nbsp;Liu&nbsp;Song&nbsp;&lt;liu.song13@....com.cn&gt;<br>&gt;&gt;&nbsp;---<br>&gt;&gt;&nbsp;&nbsp;drivers/pci/endpoint/pci-ep-cfs.c&nbsp;|&nbsp;15&nbsp;+++++----------<br>&gt;&gt;&nbsp;&nbsp;1&nbsp;file&nbsp;changed,&nbsp;5&nbsp;insertions(+),&nbsp;10&nbsp;deletions(-)<br>&gt;&gt;<br>&gt;&gt;&nbsp;diff&nbsp;--git&nbsp;a/drivers/pci/endpoint/pci-ep-cfs.c&nbsp;b/drivers/pci/endpoint/pci-ep-cfs.c<br>&gt;&gt;&nbsp;index&nbsp;ef50c82e647f..43feb6139fa3&nbsp;100644<br>&gt;&gt;&nbsp;---&nbsp;a/drivers/pci/endpoint/pci-ep-cfs.c<br>&gt;&gt;&nbsp;+++&nbsp;b/drivers/pci/endpoint/pci-ep-cfs.c<br>&gt;&gt;&nbsp;@@&nbsp;-23,7&nbsp;+23,6&nbsp;@@&nbsp;struct&nbsp;pci_epf_group&nbsp;{<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;config_group&nbsp;group;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;config_group&nbsp;primary_epc_group;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;config_group&nbsp;secondary_epc_group;<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;delayed_work&nbsp;cfs_work;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;pci_epf&nbsp;*epf;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;index;<br>&gt;&gt;&nbsp;&nbsp;};<br>&gt;&gt;&nbsp;@@&nbsp;-103,7&nbsp;+102,7&nbsp;@@&nbsp;static&nbsp;struct&nbsp;config_group<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;secondary_epc_group&nbsp;=&nbsp;&amp;epf_group-&gt;secondary_epc_group;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;config_group_init_type_name(secondary_epc_group,&nbsp;"secondary",<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;pci_secondary_epc_type);<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;configfs_register_group(&amp;epf_group-&gt;group,&nbsp;secondary_epc_group);<br>&gt;&gt;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;configfs_add_default_group(secondary_epc_group,&nbsp;&amp;epf_group-&gt;group);<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;secondary_epc_group;<br>&gt;&gt;&nbsp;&nbsp;}<br>&gt;&gt;&nbsp;@@&nbsp;-166,7&nbsp;+165,7&nbsp;@@&nbsp;static&nbsp;struct&nbsp;config_group<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;config_group_init_type_name(primary_epc_group,&nbsp;"primary",<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;pci_primary_epc_type);<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;configfs_register_group(&amp;epf_group-&gt;group,&nbsp;primary_epc_group);<br>&gt;&gt;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;configfs_add_default_group(primary_epc_group,&nbsp;&amp;epf_group-&gt;group);<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;primary_epc_group;<br>&gt;&gt;&nbsp;&nbsp;}<br>&gt;&gt;&nbsp;@@&nbsp;-570,15&nbsp;+569,13&nbsp;@@&nbsp;static&nbsp;void&nbsp;pci_ep_cfs_add_type_group(struct&nbsp;pci_epf_group&nbsp;*epf_group)<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;&gt;<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;configfs_register_group(&amp;epf_group-&gt;group,&nbsp;group);<br>&gt;&gt;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;configfs_add_default_group(group,&nbsp;&amp;epf_group-&gt;group);<br>&gt;&gt;&nbsp;&nbsp;}<br>&gt;&gt;<br>&gt;&gt;&nbsp;-static&nbsp;void&nbsp;pci_epf_cfs_work(struct&nbsp;work_struct&nbsp;*work)<br>&gt;&gt;&nbsp;+static&nbsp;void&nbsp;pci_epf_cfs_add_sub_groups(struct&nbsp;pci_epf_group&nbsp;*epf_group)<br>&gt;&gt;&nbsp;&nbsp;{<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;pci_epf_group&nbsp;*epf_group;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;struct&nbsp;config_group&nbsp;*group;<br>&gt;&gt;<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;epf_group&nbsp;=&nbsp;container_of(work,&nbsp;struct&nbsp;pci_epf_group,&nbsp;cfs_work.work);<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;group&nbsp;=&nbsp;pci_ep_cfs_add_primary_group(epf_group);<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(IS_ERR(group))&nbsp;{<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pr_err("failed&nbsp;to&nbsp;create&nbsp;'primary'&nbsp;EPC&nbsp;interface\n");<br>&gt;&gt;&nbsp;@@&nbsp;-637,9&nbsp;+634,7&nbsp;@@&nbsp;static&nbsp;struct&nbsp;config_group&nbsp;*pci_epf_make(struct&nbsp;config_group&nbsp;*group,<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;kfree(epf_name);<br>&gt;&gt;<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;INIT_DELAYED_WORK(&amp;epf_group-&gt;cfs_work,&nbsp;pci_epf_cfs_work);<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;queue_delayed_work(system_wq,&nbsp;&amp;epf_group-&gt;cfs_work,<br>&gt;&gt;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;msecs_to_jiffies(1));<br>&gt;&gt;&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;pci_epf_cfs_add_sub_groups(epf_group);<br>&gt;&gt;<br>&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&amp;epf_group-&gt;group;<br>&gt;&gt;<br>&gt;&gt;&nbsp;--<br>&gt;&gt;&nbsp;2.27.0<br>&gt;<br>&gt;--<br>&gt;மணிவண்ணன்&nbsp;சதாசிவம்<br></div></div></div></div><p><br style="white-space: normal;"></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p><br></p></div>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ