linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] How to reproduce this issue
@ 2018-12-20  8:32 Yanjiang Jin
  2018-12-20  8:32 ` [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() Yanjiang Jin
  0 siblings, 1 reply; 4+ messages in thread
From: Yanjiang Jin @ 2018-12-20  8:32 UTC (permalink / raw)
  To: don.brace, jejb, martin.petersen, yanjiang.jin
  Cc: yu.zheng, jinyanjiang, esc.storagedev, linux-scsi, linux-kernel

This happens only in the following combinations:

1. smartpqi is built as module, not built-in;
2. We have a disk connected to smartpqi card;
3. Both kexec's 1st and 2nd kernels use this disk as Rootfs' mount point.

This issue can be found on my ARM64 board: QDF2400:

kexec -l /boot/vmlinuz-4.20.0-rc6+ --initrd=/boot/initramfs-4.20.0-rc6+.img --append="$(cat /proc/cmdline)"
kexec -e

Yanjiang Jin (1):
  scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()

 drivers/scsi/smartpqi/smartpqi_init.c | 1 +
 1 file changed, 1 insertion(+)

--
1.8.3.1




This email is intended only for the named addressee. It may contain information that is confidential/private, legally privileged, or copyright-protected, and you should handle it accordingly. If you are not the intended recipient, you do not have legal rights to retain, copy, or distribute this email or its contents, and should promptly delete the email and all electronic copies in your system; do not retain copies in any media. If you have received this email in error, please notify the sender promptly. Thank you.



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

* [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()
  2018-12-20  8:32 [PATCH] How to reproduce this issue Yanjiang Jin
@ 2018-12-20  8:32 ` Yanjiang Jin
  2018-12-20 21:21   ` Don.Brace
  2018-12-21  0:39   ` Martin K. Petersen
  0 siblings, 2 replies; 4+ messages in thread
From: Yanjiang Jin @ 2018-12-20  8:32 UTC (permalink / raw)
  To: don.brace, jejb, martin.petersen, yanjiang.jin
  Cc: yu.zheng, jinyanjiang, esc.storagedev, linux-scsi, linux-kernel

We must free all irqs during shutdown, else kexec's 2nd kernel would hang
in pqi_wait_for_completion_io() as below:

Call trace:

 pqi_wait_for_completion_io
 pqi_submit_raid_request_synchronous.constprop.78+0x23c/0x310 [smartpqi]
 pqi_configure_events+0xec/0x1f8 [smartpqi]
 pqi_ctrl_init+0x814/0xca0 [smartpqi]
 pqi_pci_probe+0x400/0x46c [smartpqi]
 local_pci_probe+0x48/0xb0
 pci_device_probe+0x14c/0x1b0
 really_probe+0x218/0x3fc
 driver_probe_device+0x70/0x140
 __driver_attach+0x11c/0x134
 bus_for_each_dev+0x70/0xc8
 driver_attach+0x30/0x38
 bus_add_driver+0x1f0/0x294
 driver_register+0x74/0x12c
 __pci_register_driver+0x64/0x70
 pqi_init+0xd0/0x10000 [smartpqi]
 do_one_initcall+0x60/0x1d8
 do_init_module+0x64/0x1f8
 load_module+0x10ec/0x1350
 __se_sys_finit_module+0xd4/0x100
 __arm64_sys_finit_module+0x28/0x34
 el0_svc_handler+0x104/0x160
 el0_svc+0x8/0xc

This happens only in the following combinations:

1. smartpqi is built as module, not built-in;
2. We have a disk connected to smartpqi card;
3. Both kexec's 1st and 2nd kernels use this disk as Rootfs' mount point.

Signed-off-by: Yanjiang Jin <yanjiang.jin@hxt-semitech.com>
---
 drivers/scsi/smartpqi/smartpqi_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index a25a07a..55c1d82 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6670,6 +6670,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
         * storage.
         */
        rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
+       pqi_free_interrupts(ctrl_info);
        pqi_reset(ctrl_info);
        if (rc == 0)
                return;
--
1.8.3.1




This email is intended only for the named addressee. It may contain information that is confidential/private, legally privileged, or copyright-protected, and you should handle it accordingly. If you are not the intended recipient, you do not have legal rights to retain, copy, or distribute this email or its contents, and should promptly delete the email and all electronic copies in your system; do not retain copies in any media. If you have received this email in error, please notify the sender promptly. Thank you.



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

* RE: [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()
  2018-12-20  8:32 ` [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() Yanjiang Jin
@ 2018-12-20 21:21   ` Don.Brace
  2018-12-21  0:39   ` Martin K. Petersen
  1 sibling, 0 replies; 4+ messages in thread
From: Don.Brace @ 2018-12-20 21:21 UTC (permalink / raw)
  To: yanjiang.jin, don.brace, jejb, martin.petersen
  Cc: yu.zheng, jinyanjiang, esc.storagedev, linux-scsi, linux-kernel

-----Original Message-----
From: Yanjiang Jin [mailto:yanjiang.jin@hxt-semitech.com] 
Sent: Thursday, December 20, 2018 2:33 AM
To: don.brace@microsemi.com; jejb@linux.vnet.ibm.com; martin.petersen@oracle.com; yanjiang.jin@hxt-semitech.com
Cc: yu.zheng@hxt-semitech.com; jinyanjiang@gmail.com; esc.storagedev@microsemi.com; linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()

We must free all irqs during shutdown, else kexec's 2nd kernel would hang in pqi_wait_for_completion_io() as below:

Call trace:

 pqi_wait_for_completion_io
 pqi_submit_raid_request_


This happens only in the following combinations:

1. smartpqi is built as module, not built-in; 2. We have a disk connected to smartpqi card; 3. Both kexec's 1st and 2nd kernels use this disk as Rootfs' mount point.

Signed-off-by: Yanjiang Jin <yanjiang.jin@hxt-semitech.com>

Thank-you for your patch.

Acked-by: Don Brace <don.brace@microsemi.com>

---
 drivers/scsi/smartpqi/smartpqi_init.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c
index a25a07a..55c1d82 100644
--- a/drivers/scsi/smartpqi/smartpqi_init.c
+++ b/drivers/scsi/smartpqi/smartpqi_init.c
@@ -6670,6 +6670,7 @@ static void pqi_shutdown(struct pci_dev *pci_dev)
         * storage.
         */
        rc = pqi_flush_cache(ctrl_info, SHUTDOWN);
+       pqi_free_interrupts(ctrl_info);
        pqi_reset(ctrl_info);
        if (rc == 0)
                return;
--
1.8.3.1




This email is intended only for the named addressee. It may contain information that is confidential/private, legally privileged, or copyright-protected, and you should handle it accordingly. If you are not the intended recipient, you do not have legal rights to retain, copy, or distribute this email or its contents, and should promptly delete the email and all electronic copies in your system; do not retain copies in any media. If you have received this email in error, please notify the sender promptly. Thank you.



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

* Re: [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown()
  2018-12-20  8:32 ` [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() Yanjiang Jin
  2018-12-20 21:21   ` Don.Brace
@ 2018-12-21  0:39   ` Martin K. Petersen
  1 sibling, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2018-12-21  0:39 UTC (permalink / raw)
  To: Yanjiang Jin
  Cc: don.brace, jejb, martin.petersen, yu.zheng, jinyanjiang,
	esc.storagedev, linux-scsi, linux-kernel


Yanjiang,

> We must free all irqs during shutdown, else kexec's 2nd kernel would
> hang in pqi_wait_for_completion_io() as below:

Applied to 4.21/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2018-12-21  0:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-20  8:32 [PATCH] How to reproduce this issue Yanjiang Jin
2018-12-20  8:32 ` [PATCH] scsi: smartpqi: call pqi_free_interrupts() in pqi_shutdown() Yanjiang Jin
2018-12-20 21:21   ` Don.Brace
2018-12-21  0:39   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).