Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-23 Thread Konrad Rzeszutek Wilk
On Fri, Sep 21, 2012 at 11:27:00AM -0700, Yinghai Lu wrote:
> On Fri, Sep 21, 2012 at 9:50 AM, Konrad Rzeszutek Wilk
>  wrote:
> > On Wed, Sep 19, 2012 at 10:49:00AM -0700, Yinghai Lu wrote:
> >
> > Can you include the stack trace?
> 
> [  414.997281] pci_bus :00: freeing pci_bus info
> [  415.017221]  pci:00: freeing pci_host_bridge info
> [  415.017468] general protection fault:  [#1] SMP
> [  415.036758] Modules linked in:
> [  415.036959] CPU 0
> [  415.037051] Pid: 4, comm: kworker/0:0 Not tainted
> 3.6.0-rc6-yh-03463-gbcab6f1-dirty #303 Oracle Corporation  Sun Fire
> X4800 M2 /
> [  415.056989] RIP: 0010:[]  []
> __release_resource+0x11/0x3e
> [  415.076854] RSP: 0018:883f4cea39f0  EFLAGS: 00010206
> [  415.077112] RAX: 0d30 RBX: 897ea6cd4070 RCX: 
> 8c6318c6318c6320
> [  415.097000] RDX: 883f9d60e190 RSI: 8265f228 RDI: 
> 897ea6cd4070
> [  415.116627] RBP: 883f4cea39f0 R08: 0005 R09: 
> 810755de
> [  415.116953] R10: 81e2e7df R11:  R12: 
> 0002
> [  415.136790] R13: 897ea6d18600 R14: 826f18c0 R15: 
> 883f9d60d800
> [  415.156541] FS:  () GS:883f9d60()
> knlGS:
> [  415.156953] CS:  0010 DS:  ES:  CR0: 8005003b
> [  415.176622] CR2: 00619718 CR3: 0263f000 CR4: 
> 07f0
> [  415.196401] DR0:  DR1:  DR2: 
> 
> [  415.196761] DR3:  DR6: 0ff0 DR7: 
> 0400
> [  415.216702] Process kworker/0:0 (pid: 4, threadinfo
> 883f4cea2000, task 883f4cea8000)
> [  415.236370] Stack:
> [  415.236475]  883f4cea3a20 810755e6 883f4cea3a60
> 883f
> [  415.236866]  824884ad 88fea6ce2440 883f4cea3a40
> 81c2cfc5
> [  415.256682]  88bf4a1ec800 88bf4a1ec800 883f4cea3a50
> 81c2d023
> [  415.276452] Call Trace:
> [  415.276611]  [] release_resource+0x25/0x3e
> [  415.296206]  [] __release_pci_root_info+0x35/0x7e
> [  415.296556]  [] release_pci_root_info+0x15/0x1a
> [  415.316249]  [] pci_release_bus_bridge_dev+0x37/0x4f
> [  415.316581]  [] device_release+0x93/0xcb
> [  415.336365]  [] kobject_release+0x51/0x67
> [  415.33]  [] kobject_put+0x4a/0x4e
> [  415.361466]  [] put_device+0x17/0x19
> [  415.361734]  [] pci_remove_root_bus+0x5a/0x64
> [  415.376188]  [] acpi_pci_root_remove+0xeb/0x114
> [  415.376509]  [] acpi_device_remove+0x86/0xa5
> [  415.396230]  [] __device_release_driver+0x86/0xdc
> [  415.396551]  [] device_release_driver+0x25/0x32
> [  415.416198]  [] acpi_bus_trim+0x86/0x110
> [  415.416473]  [] handle_root_bridge_removal+0x4f/0x118
> [  415.436227]  [] _handle_hotplug_event_root+0xe1/0x121
> [  415.455957]  [] process_one_work+0x28a/0x453
> [  415.456228]  [] ? process_one_work+0x1f5/0x453
> [  415.475980]  [] ? handle_root_bridge_removal+0x118/0x118
> [  415.476311]  [] worker_thread+0x12a/0x201
> [  415.495995]  [] ? manage_workers+0xed/0xed
> [  415.496301]  [] kthread+0xe7/0xef
> [  415.515957]  [] ? _raw_spin_unlock_irq+0x2e/0x33
> [  415.516257]  [] kernel_thread_helper+0x4/0x10
> [  415.535926]  [] ? retint_restore_args+0xe/0xe
> [  415.536242]  [] ? __init_kthread_worker+0x5a/0x5a
> [  415.555959]  [] ? gs_change+0xb/0xb
> [  415.556209] Code: 48 89 31 48 89 46 20 31 c0 eb 0d 48 39 7a 08 48
> 8d 4a 28 72 da 48 89 d0 5d c3 66 66 66 66 90 48 8b 47 20 55 48 89 e5
> 48 83 c0 30 <48> 8b 10 48 85 d2 74 1e 48 39 fa 75 13 48 8b 57 28 48 89
> 10 48
> [  415.596509] RIP  [] __release_resource+0x11/0x3e
> [  415.615741]  RSP 
> [  415.616020] ---[ end trace 8bcbc1bea9c3e0bc ]---
> 
> whole log is attached.

I meant it (and a filtered with just the valid lines in it) in terms of the 
patch commit description.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-23 Thread Konrad Rzeszutek Wilk
On Fri, Sep 21, 2012 at 11:27:00AM -0700, Yinghai Lu wrote:
 On Fri, Sep 21, 2012 at 9:50 AM, Konrad Rzeszutek Wilk
 kon...@kernel.org wrote:
  On Wed, Sep 19, 2012 at 10:49:00AM -0700, Yinghai Lu wrote:
 
  Can you include the stack trace?
 
 [  414.997281] pci_bus :00: freeing pci_bus info
 [  415.017221]  pci:00: freeing pci_host_bridge info
 [  415.017468] general protection fault:  [#1] SMP
 [  415.036758] Modules linked in:
 [  415.036959] CPU 0
 [  415.037051] Pid: 4, comm: kworker/0:0 Not tainted
 3.6.0-rc6-yh-03463-gbcab6f1-dirty #303 Oracle Corporation  Sun Fire
 X4800 M2 /
 [  415.056989] RIP: 0010:[81075218]  [81075218]
 __release_resource+0x11/0x3e
 [  415.076854] RSP: 0018:883f4cea39f0  EFLAGS: 00010206
 [  415.077112] RAX: 0d30 RBX: 897ea6cd4070 RCX: 
 8c6318c6318c6320
 [  415.097000] RDX: 883f9d60e190 RSI: 8265f228 RDI: 
 897ea6cd4070
 [  415.116627] RBP: 883f4cea39f0 R08: 0005 R09: 
 810755de
 [  415.116953] R10: 81e2e7df R11:  R12: 
 0002
 [  415.136790] R13: 897ea6d18600 R14: 826f18c0 R15: 
 883f9d60d800
 [  415.156541] FS:  () GS:883f9d60()
 knlGS:
 [  415.156953] CS:  0010 DS:  ES:  CR0: 8005003b
 [  415.176622] CR2: 00619718 CR3: 0263f000 CR4: 
 07f0
 [  415.196401] DR0:  DR1:  DR2: 
 
 [  415.196761] DR3:  DR6: 0ff0 DR7: 
 0400
 [  415.216702] Process kworker/0:0 (pid: 4, threadinfo
 883f4cea2000, task 883f4cea8000)
 [  415.236370] Stack:
 [  415.236475]  883f4cea3a20 810755e6 883f4cea3a60
 883f
 [  415.236866]  824884ad 88fea6ce2440 883f4cea3a40
 81c2cfc5
 [  415.256682]  88bf4a1ec800 88bf4a1ec800 883f4cea3a50
 81c2d023
 [  415.276452] Call Trace:
 [  415.276611]  [810755e6] release_resource+0x25/0x3e
 [  415.296206]  [81c2cfc5] __release_pci_root_info+0x35/0x7e
 [  415.296556]  [81c2d023] release_pci_root_info+0x15/0x1a
 [  415.316249]  [813f568a] pci_release_bus_bridge_dev+0x37/0x4f
 [  415.316581]  [815c04d8] device_release+0x93/0xcb
 [  415.336365]  [813d5888] kobject_release+0x51/0x67
 [  415.33]  [813d579a] kobject_put+0x4a/0x4e
 [  415.361466]  [815c026a] put_device+0x17/0x19
 [  415.361734]  [813f75b2] pci_remove_root_bus+0x5a/0x64
 [  415.376188]  [81437dd8] acpi_pci_root_remove+0xeb/0x114
 [  415.376509]  [81434c13] acpi_device_remove+0x86/0xa5
 [  415.396230]  [815c33b6] __device_release_driver+0x86/0xdc
 [  415.396551]  [815c3431] device_release_driver+0x25/0x32
 [  415.416198]  [8143658b] acpi_bus_trim+0x86/0x110
 [  415.416473]  [81439ae1] handle_root_bridge_removal+0x4f/0x118
 [  415.436227]  [81439c8b] _handle_hotplug_event_root+0xe1/0x121
 [  415.455957]  [81085515] process_one_work+0x28a/0x453
 [  415.456228]  [81085480] ? process_one_work+0x1f5/0x453
 [  415.475980]  [81439baa] ? handle_root_bridge_removal+0x118/0x118
 [  415.476311]  [81085bd1] worker_thread+0x12a/0x201
 [  415.495995]  [81085aa7] ? manage_workers+0xed/0xed
 [  415.496301]  [8108b93a] kthread+0xe7/0xef
 [  415.515957]  [81e2ef03] ? _raw_spin_unlock_irq+0x2e/0x33
 [  415.516257]  [81e372e4] kernel_thread_helper+0x4/0x10
 [  415.535926]  [81e2f259] ? retint_restore_args+0xe/0xe
 [  415.536242]  [8108b853] ? __init_kthread_worker+0x5a/0x5a
 [  415.555959]  [81e372e0] ? gs_change+0xb/0xb
 [  415.556209] Code: 48 89 31 48 89 46 20 31 c0 eb 0d 48 39 7a 08 48
 8d 4a 28 72 da 48 89 d0 5d c3 66 66 66 66 90 48 8b 47 20 55 48 89 e5
 48 83 c0 30 48 8b 10 48 85 d2 74 1e 48 39 fa 75 13 48 8b 57 28 48 89
 10 48
 [  415.596509] RIP  [81075218] __release_resource+0x11/0x3e
 [  415.615741]  RSP 883f4cea39f0
 [  415.616020] ---[ end trace 8bcbc1bea9c3e0bc ]---
 
 whole log is attached.

I meant it (and a filtered with just the valid lines in it) in terms of the 
patch commit description.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-21 Thread Konrad Rzeszutek Wilk
On Wed, Sep 19, 2012 at 10:49:00AM -0700, Yinghai Lu wrote:
> Found one system one root bus hot remove get panic.

Boy, this is mangled.

Can you include the name of the system? Perhaps you can
rephrase this to say:

"On XYZ removing the root bus (through ACPI unplug) causes
a panic."

> Panic happens when try to release hostbridge resource.

Can you include the stack trace?
> 
> It turns out that resource get reject during put into resource tree
> because of conflicts.

Come again? Are you saying:

"The reason for this is that the resources was never initialized
properly because of .. (what type of conflict?)"?

> Also that resource parent pointer have random value.
> 
> That invalid value cause it pass through check __release_pci_root_info
> and panic in release_resource.
> 
> Try to use kzalloc instead.

It is not just try, it _is_ using that now.

> 
> Signed-off-by: Yinghai Lu 
> Cc: x...@kernel.org
> 
> ---
>  arch/x86/pci/acpi.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> Index: linux-2.6/arch/x86/pci/acpi.c
> ===
> --- linux-2.6.orig/arch/x86/pci/acpi.c
> +++ linux-2.6/arch/x86/pci/acpi.c
> @@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acp
>   res->flags = flags;
>   res->start = start;
>   res->end = end;
> - res->child = NULL;
>  
>   if (!pci_use_crs) {
>   dev_printk(KERN_DEBUG, >bridge->dev,
> @@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info
>  
>   size = sizeof(*info->res) * info->res_num;
>   info->res_num = 0;
> - info->res = kmalloc(size, GFP_KERNEL);
> + info->res = kzalloc(size, GFP_KERNEL);
>   if (!info->res)
>   return;
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-21 Thread Konrad Rzeszutek Wilk
On Wed, Sep 19, 2012 at 10:49:00AM -0700, Yinghai Lu wrote:
 Found one system one root bus hot remove get panic.

Boy, this is mangled.

Can you include the name of the system? Perhaps you can
rephrase this to say:

On XYZ removing the root bus (through ACPI unplug) causes
a panic.

 Panic happens when try to release hostbridge resource.

Can you include the stack trace?
 
 It turns out that resource get reject during put into resource tree
 because of conflicts.

Come again? Are you saying:

The reason for this is that the resources was never initialized
properly because of .. (what type of conflict?)?

 Also that resource parent pointer have random value.
 
 That invalid value cause it pass through check __release_pci_root_info
 and panic in release_resource.
 
 Try to use kzalloc instead.

It is not just try, it _is_ using that now.

 
 Signed-off-by: Yinghai Lu ying...@kernel.org
 Cc: x...@kernel.org
 
 ---
  arch/x86/pci/acpi.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 Index: linux-2.6/arch/x86/pci/acpi.c
 ===
 --- linux-2.6.orig/arch/x86/pci/acpi.c
 +++ linux-2.6/arch/x86/pci/acpi.c
 @@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acp
   res-flags = flags;
   res-start = start;
   res-end = end;
 - res-child = NULL;
  
   if (!pci_use_crs) {
   dev_printk(KERN_DEBUG, info-bridge-dev,
 @@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info
  
   size = sizeof(*info-res) * info-res_num;
   info-res_num = 0;
 - info-res = kmalloc(size, GFP_KERNEL);
 + info-res = kzalloc(size, GFP_KERNEL);
   if (!info-res)
   return;
  
 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
 
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Yinghai Lu
On Wed, Sep 19, 2012 at 6:12 AM, Bjorn Helgaas  wrote:
>> yes, but they don't support pci_set_host_bridge_release yet. so they
>> should not meet this problem yet.
>
> Why should we wait to fix that bug until later?  I'm not interested in
> debugging this in the future.  If you fix a bug, you should always try
> to fix other occurrences of the same bug at the same time.

ok, will update the patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Jiang Liu
On 09/19/2012 07:49 AM, Yinghai Lu wrote:
> On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas  wrote:
>> On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu  wrote:
>>> Found one system one root bus hot remove get panic.
>>> Panic happens when try to release hostbridge resource.
>>>
>>> It turns out that resource get reject during put into resource tree
>>> because of conflicts.
>>> Also that resource parent pointer have random value.
>>>
>>> That invalid value cause it pass through check __release_pci_root_info
>>> and panic in release_resource.
>>>
>>> Try to use kzalloc instead.
>>
>> Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
>> what it does:
>>
>> if (windows) {
>> controller->window =
>> kmalloc_node(sizeof(*controller->window) * windows,
>>  GFP_KERNEL, controller->node);
>>
> 
> 
> yes, but they don't support pci_set_host_bridge_release yet. so they
> should not meet this problem yet.
Hi Yinghai,
We are trying to add pci_set_host_bridge_release() for IA64, so would
appreciate it if you could help to fix IA64 too.
--Gerry

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Bjorn Helgaas
On Tue, Sep 18, 2012 at 5:49 PM, Yinghai Lu  wrote:
> On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas  wrote:
>> On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu  wrote:
>>> Found one system one root bus hot remove get panic.
>>> Panic happens when try to release hostbridge resource.
>>>
>>> It turns out that resource get reject during put into resource tree
>>> because of conflicts.
>>> Also that resource parent pointer have random value.
>>>
>>> That invalid value cause it pass through check __release_pci_root_info
>>> and panic in release_resource.
>>>
>>> Try to use kzalloc instead.
>>
>> Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
>> what it does:
>>
>> if (windows) {
>> controller->window =
>> kmalloc_node(sizeof(*controller->window) * windows,
>>  GFP_KERNEL, controller->node);
>>
>
>
> yes, but they don't support pci_set_host_bridge_release yet. so they
> should not meet this problem yet.

Why should we wait to fix that bug until later?  I'm not interested in
debugging this in the future.  If you fix a bug, you should always try
to fix other occurrences of the same bug at the same time.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Bjorn Helgaas
On Tue, Sep 18, 2012 at 5:49 PM, Yinghai Lu ying...@kernel.org wrote:
 On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas bhelg...@google.com wrote:
 On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu ying...@kernel.org wrote:
 Found one system one root bus hot remove get panic.
 Panic happens when try to release hostbridge resource.

 It turns out that resource get reject during put into resource tree
 because of conflicts.
 Also that resource parent pointer have random value.

 That invalid value cause it pass through check __release_pci_root_info
 and panic in release_resource.

 Try to use kzalloc instead.

 Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
 what it does:

 if (windows) {
 controller-window =
 kmalloc_node(sizeof(*controller-window) * windows,
  GFP_KERNEL, controller-node);



 yes, but they don't support pci_set_host_bridge_release yet. so they
 should not meet this problem yet.

Why should we wait to fix that bug until later?  I'm not interested in
debugging this in the future.  If you fix a bug, you should always try
to fix other occurrences of the same bug at the same time.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Jiang Liu
On 09/19/2012 07:49 AM, Yinghai Lu wrote:
 On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas bhelg...@google.com wrote:
 On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu ying...@kernel.org wrote:
 Found one system one root bus hot remove get panic.
 Panic happens when try to release hostbridge resource.

 It turns out that resource get reject during put into resource tree
 because of conflicts.
 Also that resource parent pointer have random value.

 That invalid value cause it pass through check __release_pci_root_info
 and panic in release_resource.

 Try to use kzalloc instead.

 Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
 what it does:

 if (windows) {
 controller-window =
 kmalloc_node(sizeof(*controller-window) * windows,
  GFP_KERNEL, controller-node);

 
 
 yes, but they don't support pci_set_host_bridge_release yet. so they
 should not meet this problem yet.
Hi Yinghai,
We are trying to add pci_set_host_bridge_release() for IA64, so would
appreciate it if you could help to fix IA64 too.
--Gerry

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-19 Thread Yinghai Lu
On Wed, Sep 19, 2012 at 6:12 AM, Bjorn Helgaas bhelg...@google.com wrote:
 yes, but they don't support pci_set_host_bridge_release yet. so they
 should not meet this problem yet.

 Why should we wait to fix that bug until later?  I'm not interested in
 debugging this in the future.  If you fix a bug, you should always try
 to fix other occurrences of the same bug at the same time.

ok, will update the patch.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-18 Thread Yinghai Lu
On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas  wrote:
> On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu  wrote:
>> Found one system one root bus hot remove get panic.
>> Panic happens when try to release hostbridge resource.
>>
>> It turns out that resource get reject during put into resource tree
>> because of conflicts.
>> Also that resource parent pointer have random value.
>>
>> That invalid value cause it pass through check __release_pci_root_info
>> and panic in release_resource.
>>
>> Try to use kzalloc instead.
>
> Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
> what it does:
>
> if (windows) {
> controller->window =
> kmalloc_node(sizeof(*controller->window) * windows,
>  GFP_KERNEL, controller->node);
>


yes, but they don't support pci_set_host_bridge_release yet. so they
should not meet this problem yet.

Thanks

Yinghai
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-18 Thread Bjorn Helgaas
On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu  wrote:
> Found one system one root bus hot remove get panic.
> Panic happens when try to release hostbridge resource.
>
> It turns out that resource get reject during put into resource tree
> because of conflicts.
> Also that resource parent pointer have random value.
>
> That invalid value cause it pass through check __release_pci_root_info
> and panic in release_resource.
>
> Try to use kzalloc instead.

Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
what it does:

if (windows) {
controller->window =
kmalloc_node(sizeof(*controller->window) * windows,
 GFP_KERNEL, controller->node);


> Signed-off-by: Yinghai Lu 
> Cc: x...@kernel.org
>
> ---
>  arch/x86/pci/acpi.c |3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: linux-2.6/arch/x86/pci/acpi.c
> ===
> --- linux-2.6.orig/arch/x86/pci/acpi.c
> +++ linux-2.6/arch/x86/pci/acpi.c
> @@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acp
> res->flags = flags;
> res->start = start;
> res->end = end;
> -   res->child = NULL;
>
> if (!pci_use_crs) {
> dev_printk(KERN_DEBUG, >bridge->dev,
> @@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info
>
> size = sizeof(*info->res) * info->res_num;
> info->res_num = 0;
> -   info->res = kmalloc(size, GFP_KERNEL);
> +   info->res = kzalloc(size, GFP_KERNEL);
> if (!info->res)
> return;
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-18 Thread Bjorn Helgaas
On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu ying...@kernel.org wrote:
 Found one system one root bus hot remove get panic.
 Panic happens when try to release hostbridge resource.

 It turns out that resource get reject during put into resource tree
 because of conflicts.
 Also that resource parent pointer have random value.

 That invalid value cause it pass through check __release_pci_root_info
 and panic in release_resource.

 Try to use kzalloc instead.

Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
what it does:

if (windows) {
controller-window =
kmalloc_node(sizeof(*controller-window) * windows,
 GFP_KERNEL, controller-node);


 Signed-off-by: Yinghai Lu ying...@kernel.org
 Cc: x...@kernel.org

 ---
  arch/x86/pci/acpi.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

 Index: linux-2.6/arch/x86/pci/acpi.c
 ===
 --- linux-2.6.orig/arch/x86/pci/acpi.c
 +++ linux-2.6/arch/x86/pci/acpi.c
 @@ -305,7 +305,6 @@ setup_resource(struct acpi_resource *acp
 res-flags = flags;
 res-start = start;
 res-end = end;
 -   res-child = NULL;

 if (!pci_use_crs) {
 dev_printk(KERN_DEBUG, info-bridge-dev,
 @@ -434,7 +433,7 @@ probe_pci_root_info(struct pci_root_info

 size = sizeof(*info-res) * info-res_num;
 info-res_num = 0;
 -   info-res = kmalloc(size, GFP_KERNEL);
 +   info-res = kzalloc(size, GFP_KERNEL);
 if (!info-res)
 return;

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] PCI, x86: clear initial value for root info resources

2012-09-18 Thread Yinghai Lu
On Tue, Sep 18, 2012 at 3:46 PM, Bjorn Helgaas bhelg...@google.com wrote:
 On Fri, Sep 14, 2012 at 6:48 PM, Yinghai Lu ying...@kernel.org wrote:
 Found one system one root bus hot remove get panic.
 Panic happens when try to release hostbridge resource.

 It turns out that resource get reject during put into resource tree
 because of conflicts.
 Also that resource parent pointer have random value.

 That invalid value cause it pass through check __release_pci_root_info
 and panic in release_resource.

 Try to use kzalloc instead.

 Don't we need the same fix for ia64 in pci_acpi_scan_root()?  Here's
 what it does:

 if (windows) {
 controller-window =
 kmalloc_node(sizeof(*controller-window) * windows,
  GFP_KERNEL, controller-node);



yes, but they don't support pci_set_host_bridge_release yet. so they
should not meet this problem yet.

Thanks

Yinghai
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/