All of lore.kernel.org
 help / color / mirror / Atom feed
* [regression] vmw_pvscsi probe fails on 4.11
@ 2017-03-02  8:51 Loïc Yhuel
  2017-03-02 16:05 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Loïc Yhuel @ 2017-03-02  8:51 UTC (permalink / raw)
  To: Christoph Hellwig, Jim Gill; +Cc: linux-scsi

Hi,

On Fedora Rawhide (reproduced on git master), vmw_pvscsi probe fails.
It also calls free_irq during cleanup, which produces a warning since it 
didn't
call request_irq in this case.

Reverting commit 2e48e34 (scsi: vmw_pvscsi: switch to pci_alloc_irq_vectors)
fixes the issue (I get "vmw_pvscsi: using MSI-X", and it uses the IRQ 78).

[    2.671383] vmw_pvscsi: using 64bit dma
[    2.671750] vmw_pvscsi: max_id: 16
[    2.671752] vmw_pvscsi: setting ring_pages to 8
[    2.673209] ------------[ cut here ]------------
[    2.673219] WARNING: CPU: 2 PID: 402 at kernel/irq/manage.c:1478 
__free_irq+0xa4/0x2e0
[    2.673220] Trying to free already-free IRQ 78
[    2.673221] Modules linked in: serio_raw vmw_pvscsi(+) vmxnet3 
ata_generic pata_acpi fjes vmwgfx drm_kms_helper ttm drm
[    2.673236] CPU: 2 PID: 402 Comm: systemd-udevd Not tainted 
4.11.0r0-test1+ #2
[    2.673238] Hardware name: VMware, Inc. VMware Virtual Platform/440BX 
Desktop Reference Platform, BIOS 6.00 07/02/2015
[    2.673239] Call Trace:
[    2.673244]  dump_stack+0x8e/0xd1
[    2.673248]  __warn+0xcb/0xf0
[    2.673252]  warn_slowpath_fmt+0x5f/0x80
[    2.673257]  ? _raw_spin_lock_irqsave+0x82/0x90
[    2.673259]  ? __free_irq+0x5f/0x2e0
[    2.673262]  __free_irq+0xa4/0x2e0
[    2.673265]  ? __pci_enable_msix+0x234/0x520
[    2.673269]  free_irq+0x39/0x90
[    2.673274]  pvscsi_shutdown_intr+0x25/0x40 [vmw_pvscsi]
[    2.673277]  pvscsi_release_resources+0x1e/0x370 [vmw_pvscsi]
[    2.673281]  pvscsi_probe+0xd2e/0x10a4 [vmw_pvscsi]
[    2.673306]  local_pci_probe+0x42/0xa0
[    2.673308]  ? pci_match_device+0xe0/0x110
[    2.673311]  pci_device_probe+0xbe/0x150
[    2.673313]  ? _raw_spin_unlock+0x27/0x40
[    2.673318]  driver_probe_device+0x106/0x450
[    2.673322]  __driver_attach+0xa8/0xf0
[    2.673325]  ? driver_probe_device+0x450/0x450
[    2.673327]  bus_for_each_dev+0x75/0xc0
[    2.673331]  driver_attach+0x1e/0x20
[    2.673333]  bus_add_driver+0x1d3/0x270
[    2.673335]  ? 0xffffffffc032d000
[    2.673338]  driver_register+0x60/0xe0
[    2.673340]  ? 0xffffffffc032d000
[    2.673342]  __pci_register_driver+0x60/0x70
[    2.673345]  pvscsi_init+0x38/0x1000 [vmw_pvscsi]
[    2.673348]  do_one_initcall+0x50/0x1a0
[    2.673351]  ? rcu_read_lock_sched_held+0x79/0x80
[    2.673354]  ? kmem_cache_alloc_trace+0x273/0x2e0
[    2.673356]  ? do_init_module+0x27/0x1e8
[    2.673361]  do_init_module+0x5f/0x1e8
[    2.673365]  load_module+0x2386/0x29d0
[    2.673367]  ? __symbol_put+0x70/0x70
[    2.673371]  ? show_coresize+0x30/0x30
[    2.673375]  ? vfs_read+0x131/0x180
[    2.673386]  SYSC_finit_module+0xf6/0x110
[    2.673395]  SyS_finit_module+0xe/0x10
[    2.673397]  do_syscall_64+0x6c/0x1f0
[    2.673400]  entry_SYSCALL64_slow_path+0x25/0x25
[    2.673402] RIP: 0033:0x7f770375e5d9
[    2.673403] RSP: 002b:00007fff59d224b8 EFLAGS: 00000246 ORIG_RAX: 
0000000000000139
[    2.673406] RAX: ffffffffffffffda RBX: 000056462cb91f20 RCX: 
00007f770375e5d9
[    2.673407] RDX: 0000000000000000 RSI: 00007f77042999c5 RDI: 
0000000000000006
[    2.673408] RBP: 00007f77042999c5 R08: 0000000000000000 R09: 
00007fff59d225d0
[    2.673409] R10: 0000000000000006 R11: 0000000000000246 R12: 
0000000000000000
[    2.673410] R13: 000056462cb8fcd0 R14: 0000000000020000 R15: 
000056462ae4cd81
[    2.673419] ---[ end trace 19fc54ed551e946e ]---
[    2.677816] vmw_pvscsi 0000:13:00.0: Driver probe function 
unexpectedly returned 1

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

* Re: [regression] vmw_pvscsi probe fails on 4.11
  2017-03-02  8:51 [regression] vmw_pvscsi probe fails on 4.11 Loïc Yhuel
@ 2017-03-02 16:05 ` Christoph Hellwig
  2017-03-02 19:39   ` Loïc Yhuel
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2017-03-02 16:05 UTC (permalink / raw)
  To: Loïc Yhuel; +Cc: Christoph Hellwig, Jim Gill, linux-scsi

Please try this patch:

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index ef474a748744..c374e3b5c678 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1487,7 +1487,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		irq_flag &= ~PCI_IRQ_MSI;
 
 	error = pci_alloc_irq_vectors(adapter->dev, 1, 1, irq_flag);
-	if (error)
+	if (error < 0)
 		goto out_reset_adapter;
 
 	adapter->use_req_threshold = pvscsi_setup_req_threshold(adapter, true);

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

* Re: [regression] vmw_pvscsi probe fails on 4.11
  2017-03-02 16:05 ` Christoph Hellwig
@ 2017-03-02 19:39   ` Loïc Yhuel
  0 siblings, 0 replies; 3+ messages in thread
From: Loïc Yhuel @ 2017-03-02 19:39 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Jim Gill, linux-scsi

Le 02/03/2017 à 17:05, Christoph Hellwig a écrit :
> Please try this patch:
>
> diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
> index ef474a748744..c374e3b5c678 100644
> --- a/drivers/scsi/vmw_pvscsi.c
> +++ b/drivers/scsi/vmw_pvscsi.c
> @@ -1487,7 +1487,7 @@ static int pvscsi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>   		irq_flag &= ~PCI_IRQ_MSI;
>   
>   	error = pci_alloc_irq_vectors(adapter->dev, 1, 1, irq_flag);
> -	if (error)
> +	if (error < 0)
>   		goto out_reset_adapter;
>   
>   	adapter->use_req_threshold = pvscsi_setup_req_threshold(adapter, true);
It works, thanks.

Btw, vmw_vmci has the same issue.

diff --git a/drivers/misc/vmw_vmci/vmci_guest.c 
b/drivers/misc/vmw_vmci/vmci_guest.c
index 9d659542a335..dad5abee656e 100644
--- a/drivers/misc/vmw_vmci/vmci_guest.c
+++ b/drivers/misc/vmw_vmci/vmci_guest.c
@@ -566,10 +566,10 @@ static int vmci_guest_probe_device(struct pci_dev 
*pdev,
          */
         error = pci_alloc_irq_vectors(pdev, VMCI_MAX_INTRS, VMCI_MAX_INTRS,
                         PCI_IRQ_MSIX);
-       if (error) {
+       if (error < 0) {
                 error = pci_alloc_irq_vectors(pdev, 1, 1,
                                 PCI_IRQ_MSIX | PCI_IRQ_MSI | 
PCI_IRQ_LEGACY);
-               if (error)
+               if (error < 0)
                         goto err_remove_bitmap;
         } else {
                 vmci_dev->exclusive_vectors = true;

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-02  8:51 [regression] vmw_pvscsi probe fails on 4.11 Loïc Yhuel
2017-03-02 16:05 ` Christoph Hellwig
2017-03-02 19:39   ` Loïc Yhuel

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.