* [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic.
@ 2015-05-08 18:48 Himanshu Madhani
2015-05-10 16:46 ` Ben Hutchings
0 siblings, 1 reply; 5+ messages in thread
From: Himanshu Madhani @ 2015-05-08 18:48 UTC (permalink / raw)
To: stable; +Cc: giridhar.malavali, himanshu.madhani, andrew.vasquez
From: Saurav Kashyap <saurav.kashyap@qlogic.com>
This patch fixes a kernel panic for qla2xxx Target core
Module driver introduced by a fix in the qla2xxx initiator code.
Commit ef86cb2 ("qla2xxx: Mark port lost when we receive an RSCN for it.")
introduced the regression for qla2xxx Target driver.
Following stack trace will be observed
--- <NMI exception stack> ---
[ffff88081faa3cc8] _raw_spin_lock_irqsave at ffffffff815b1f03
[ffff88081faa3cd0] qlt_fc_port_deleted at ffffffffa096ccd0 [qla2xxx]
[ffff88081faa3d20] qla2x00_schedule_rport_del at ffffffffa0913831[qla2xxx]
[ffff88081faa3d50] qla2x00_mark_device_lost at ffffffffa09159c5[qla2xxx]
[ffff88081faa3db0] qla2x00_async_event at ffffffffa0938d59 [qla2xxx]
[ffff88081faa3e30] qla24xx_msix_default at ffffffffa093a326 [qla2xxx]
[ffff88081faa3e90] handle_irq_event_percpu at ffffffff810a7b8d
[ffff88081faa3ee0] handle_irq_event at ffffffff810a7d32
[ffff88081faa3f10] handle_edge_irq at ffffffff810ab6b9
[ffff88081faa3f30] handle_irq at ffffffff8100619c
[ffff88081faa3f70] do_IRQ at ffffffff815b4b1c
--- <IRQ stack> ---
Cc: <stable@vger.kernel.org>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 4 ++++
drivers/scsi/qla2xxx/qla_target.c | 6 ------
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 285cb20..3c1550a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2924,6 +2924,7 @@ qla2x00_rport_del(void *data)
struct fc_rport *rport;
scsi_qla_host_t *vha = fcport->vha;
unsigned long flags;
+ unsigned long vha_flags;
spin_lock_irqsave(fcport->vha->host->host_lock, flags);
rport = fcport->drport ? fcport->drport: fcport->rport;
@@ -2935,7 +2936,9 @@ qla2x00_rport_del(void *data)
* Release the target mode FC NEXUS in qla_target.c code
* if target mod is enabled.
*/
+ spin_lock_irqsave(&vha->hw->hardware_lock, vha_flags);
qlt_fc_port_deleted(vha, fcport);
+ spin_unlock_irqrestore(&vha->hw->hardware_lock, vha_flags);
}
}
@@ -3303,6 +3306,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
* Create target mode FC NEXUS in qla_target.c if target mode is
* enabled..
*/
+
qlt_fc_port_added(vha, fcport);
spin_lock_irqsave(fcport->vha->host->host_lock, flags);
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 5741825..83e0626 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -782,10 +782,8 @@ void qlt_fc_port_added(struct scsi_qla_host *vha, fc_port_t *fcport)
void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
{
- struct qla_hw_data *ha = vha->hw;
struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
struct qla_tgt_sess *sess;
- unsigned long flags;
if (!vha->hw->tgt.tgt_ops)
return;
@@ -793,14 +791,11 @@ void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
if (!tgt || (fcport->port_type != FCT_INITIATOR))
return;
- spin_lock_irqsave(&ha->hardware_lock, flags);
if (tgt->tgt_stop) {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
return;
}
sess = qlt_find_sess_by_port_name(tgt, fcport->port_name);
if (!sess) {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
return;
}
@@ -808,7 +803,6 @@ void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
sess->local = 1;
qlt_schedule_sess_for_deletion(sess, false);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
static inline int test_tgt_sess_count(struct qla_tgt *tgt)
--
1.7.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic.
2015-05-08 18:48 Himanshu Madhani
@ 2015-05-10 16:46 ` Ben Hutchings
0 siblings, 0 replies; 5+ messages in thread
From: Ben Hutchings @ 2015-05-10 16:46 UTC (permalink / raw)
To: Himanshu Madhani; +Cc: stable, giridhar.malavali, andrew.vasquez
[-- Attachment #1: Type: text/plain, Size: 1697 bytes --]
On Fri, 2015-05-08 at 14:48 -0400, Himanshu Madhani wrote:
> From: Saurav Kashyap <saurav.kashyap@qlogic.com>
>
> This patch fixes a kernel panic for qla2xxx Target core
> Module driver introduced by a fix in the qla2xxx initiator code.
>
> Commit ef86cb2 ("qla2xxx: Mark port lost when we receive an RSCN for it.")
> introduced the regression for qla2xxx Target driver.
>
> Following stack trace will be observed
>
> --- <NMI exception stack> ---
> [ffff88081faa3cc8] _raw_spin_lock_irqsave at ffffffff815b1f03
> [ffff88081faa3cd0] qlt_fc_port_deleted at ffffffffa096ccd0 [qla2xxx]
> [ffff88081faa3d20] qla2x00_schedule_rport_del at ffffffffa0913831[qla2xxx]
> [ffff88081faa3d50] qla2x00_mark_device_lost at ffffffffa09159c5[qla2xxx]
> [ffff88081faa3db0] qla2x00_async_event at ffffffffa0938d59 [qla2xxx]
> [ffff88081faa3e30] qla24xx_msix_default at ffffffffa093a326 [qla2xxx]
> [ffff88081faa3e90] handle_irq_event_percpu at ffffffff810a7b8d
> [ffff88081faa3ee0] handle_irq_event at ffffffff810a7d32
> [ffff88081faa3f10] handle_edge_irq at ffffffff810ab6b9
> [ffff88081faa3f30] handle_irq at ffffffff8100619c
> [ffff88081faa3f70] do_IRQ at ffffffff815b4b1c
> --- <IRQ stack> ---
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
> Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
[...]
<Not-a-pre-recorded-message>
This is not the correct way to send patches to stable. Please read
Documentation/stable_kernel_rules.txt
Specifically, you have not identified the upstream commit hash.
</Not-a-pre-recorded-message>
Ben.
--
Ben Hutchings
When in doubt, use brute force. - Ken Thompson
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic.
@ 2015-05-11 20:53 Himanshu Madhani
2015-06-29 21:29 ` Greg KH
0 siblings, 1 reply; 5+ messages in thread
From: Himanshu Madhani @ 2015-05-11 20:53 UTC (permalink / raw)
To: stable; +Cc: giridhar.malavali, himanshu.madhani, andrew.vasquez
From: Saurav Kashyap <saurav.kashyap@qlogic.com>
[ Upstream commit ef86cb2059a14b4024c7320999ee58e938873032 ]
This patch fixes a kernel panic for qla2xxx Target core
Module driver introduced by a fix in the qla2xxx initiator code.
Commit ef86cb2 ("qla2xxx: Mark port lost when we receive an RSCN for it.")
introduced the regression for qla2xxx Target driver.
Stack trace will have following signature
--- <NMI exception stack> ---
[ffff88081faa3cc8] _raw_spin_lock_irqsave at ffffffff815b1f03
[ffff88081faa3cd0] qlt_fc_port_deleted at ffffffffa096ccd0 [qla2xxx]
[ffff88081faa3d20] qla2x00_schedule_rport_del at ffffffffa0913831[qla2xxx]
[ffff88081faa3d50] qla2x00_mark_device_lost at ffffffffa09159c5[qla2xxx]
[ffff88081faa3db0] qla2x00_async_event at ffffffffa0938d59 [qla2xxx]
[ffff88081faa3e30] qla24xx_msix_default at ffffffffa093a326 [qla2xxx]
[ffff88081faa3e90] handle_irq_event_percpu at ffffffff810a7b8d
[ffff88081faa3ee0] handle_irq_event at ffffffff810a7d32
[ffff88081faa3f10] handle_edge_irq at ffffffff810ab6b9
[ffff88081faa3f30] handle_irq at ffffffff8100619c
[ffff88081faa3f70] do_IRQ at ffffffff815b4b1c
--- <IRQ stack> ---
Cc: <stable@vger.kernel.org>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 4 ++++
drivers/scsi/qla2xxx/qla_target.c | 6 ------
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 285cb20..3c1550a 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2924,6 +2924,7 @@ qla2x00_rport_del(void *data)
struct fc_rport *rport;
scsi_qla_host_t *vha = fcport->vha;
unsigned long flags;
+ unsigned long vha_flags;
spin_lock_irqsave(fcport->vha->host->host_lock, flags);
rport = fcport->drport ? fcport->drport: fcport->rport;
@@ -2935,7 +2936,9 @@ qla2x00_rport_del(void *data)
* Release the target mode FC NEXUS in qla_target.c code
* if target mod is enabled.
*/
+ spin_lock_irqsave(&vha->hw->hardware_lock, vha_flags);
qlt_fc_port_deleted(vha, fcport);
+ spin_unlock_irqrestore(&vha->hw->hardware_lock, vha_flags);
}
}
@@ -3303,6 +3306,7 @@ qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport)
* Create target mode FC NEXUS in qla_target.c if target mode is
* enabled..
*/
+
qlt_fc_port_added(vha, fcport);
spin_lock_irqsave(fcport->vha->host->host_lock, flags);
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index 5741825..83e0626 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -782,10 +782,8 @@ void qlt_fc_port_added(struct scsi_qla_host *vha, fc_port_t *fcport)
void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
{
- struct qla_hw_data *ha = vha->hw;
struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
struct qla_tgt_sess *sess;
- unsigned long flags;
if (!vha->hw->tgt.tgt_ops)
return;
@@ -793,14 +791,11 @@ void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
if (!tgt || (fcport->port_type != FCT_INITIATOR))
return;
- spin_lock_irqsave(&ha->hardware_lock, flags);
if (tgt->tgt_stop) {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
return;
}
sess = qlt_find_sess_by_port_name(tgt, fcport->port_name);
if (!sess) {
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
return;
}
@@ -808,7 +803,6 @@ void qlt_fc_port_deleted(struct scsi_qla_host *vha, fc_port_t *fcport)
sess->local = 1;
qlt_schedule_sess_for_deletion(sess, false);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
}
static inline int test_tgt_sess_count(struct qla_tgt *tgt)
--
1.7.7
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic.
2015-05-11 20:53 [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic Himanshu Madhani
@ 2015-06-29 21:29 ` Greg KH
2015-07-08 15:54 ` Himanshu Madhani
0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2015-06-29 21:29 UTC (permalink / raw)
To: Himanshu Madhani; +Cc: stable, giridhar.malavali, andrew.vasquez
On Mon, May 11, 2015 at 04:53:21PM -0400, Himanshu Madhani wrote:
> From: Saurav Kashyap <saurav.kashyap@qlogic.com>
>
> [ Upstream commit ef86cb2059a14b4024c7320999ee58e938873032 ]
No this is not.
>
> This patch fixes a kernel panic for qla2xxx Target core
> Module driver introduced by a fix in the qla2xxx initiator code.
>
> Commit ef86cb2 ("qla2xxx: Mark port lost when we receive an RSCN for it.")
> introduced the regression for qla2xxx Target driver.
That commit showed up in 3.18, so where do you want this patch to go?
What is the git id of it in Linus's tree?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic.
2015-06-29 21:29 ` Greg KH
@ 2015-07-08 15:54 ` Himanshu Madhani
0 siblings, 0 replies; 5+ messages in thread
From: Himanshu Madhani @ 2015-07-08 15:54 UTC (permalink / raw)
To: Greg KH; +Cc: stable@vger.kernel.org, Giridhar Malavali, Andrew Vasquez
Hi Greg,
On 6/29/15, 2:29 PM, "Greg KH" <greg@kroah.com> wrote:
>On Mon, May 11, 2015 at 04:53:21PM -0400, Himanshu Madhani wrote:
>> From: Saurav Kashyap <saurav.kashyap@qlogic.com>
>>
>> [ Upstream commit ef86cb2059a14b4024c7320999ee58e938873032 ]
>
>No this is not.
>
>>
>> This patch fixes a kernel panic for qla2xxx Target core
>> Module driver introduced by a fix in the qla2xxx initiator code.
>>
>> Commit ef86cb2 ("qla2xxx: Mark port lost when we receive an RSCN for
>>it.")
>> introduced the regression for qla2xxx Target driver.
>
>That commit showed up in 3.18, so where do you want this patch to go?
All stable trees 3.18 and above.
>
>What is the git id of it in Linus's tree?
>From what I can tell, the git commit is correct
# git show ef86cb2059a14b4024c7320999ee58e938873032
commit ef86cb2059a14b4024c7320999ee58e938873032
Author: Chad Dupuis <chad.dupuis@qlogic.com>
Date: Thu Sep 25 05:17:01 2014 -0400
qla2xxx: Mark port lost when we receive an RSCN for it.
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
>
>thanks,
>
>greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-08 15:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-11 20:53 [PATCH RESEND] qla2xxx: Fix hardware lock/unlock issue causing kernel panic Himanshu Madhani
2015-06-29 21:29 ` Greg KH
2015-07-08 15:54 ` Himanshu Madhani
-- strict thread matches above, loose matches on Subject: below --
2015-05-08 18:48 Himanshu Madhani
2015-05-10 16:46 ` Ben Hutchings
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).