* re: [SCSI] pm8001: Fix bogus interrupt state flag issue.
@ 2012-03-01 14:22 Dan Carpenter
2012-03-01 14:24 ` santosh prasad nayak
2012-03-02 1:06 ` Jack Wang
0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2012-03-01 14:22 UTC (permalink / raw)
To: santoshprasadnayak; +Cc: Jack Wang, linux-scsi
Hello Santosh Nayak,
The patch bdaefbf580cd: "[SCSI] pm8001: Fix bogus interrupt state
flag issue." from Feb 26, 2012, leads to the following warning:
drivers/scsi/pm8001/pm8001_hwi.c:2400 mpi_sata_completion()
error: double unlock 'irq:'
} else if (t->uldd_task) {
- spin_unlock_irqrestore(&t->task_state_lock, flags);
+ spin_unlock_irq(&t->task_state_lock);
^^^^^^^^^^^^^^^
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* ditto */
- spin_unlock_irqrestore(&pm8001_ha->lock, flags);
+ spin_unlock_irq(&pm8001_ha->lock);
^^^^^^^^^^^^^^^
It doesn't make sense to enable IRQs twice. I'm not sure if it should
be the first or second unlock which enables them.
t->task_done(t);
- spin_lock_irqsave(&pm8001_ha->lock, flags);
+ spin_lock_irq(&pm8001_ha->lock);
} else if (!t->uldd_task) {
- spin_unlock_irqrestore(&t->task_state_lock, flags);
+ spin_unlock_irq(&t->task_state_lock);
^^^^^^^^^^^^^^^
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/*ditto*/
- spin_unlock_irqrestore(&pm8001_ha->lock, flags);
+ spin_unlock_irq(&pm8001_ha->lock);
^^^^^^^^^^^^^^^
Same thing again.
t->task_done(t);
- spin_lock_irqsave(&pm8001_ha->lock, flags);
+ spin_lock_irq(&pm8001_ha->lock);
}
regards,
dan carpenter
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [SCSI] pm8001: Fix bogus interrupt state flag issue.
2012-03-01 14:22 [SCSI] pm8001: Fix bogus interrupt state flag issue Dan Carpenter
@ 2012-03-01 14:24 ` santosh prasad nayak
2012-03-01 14:37 ` Dan Carpenter
2012-03-02 1:06 ` Jack Wang
1 sibling, 1 reply; 5+ messages in thread
From: santosh prasad nayak @ 2012-03-01 14:24 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jack Wang, linux-scsi
The warnings are there since from the beginning.
Even before my fix.
There are two locks:
1. pm8001_ha->lock
2. t->task_state_lock
regards
santosh
On Thu, Mar 1, 2012 at 7:52 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Hello Santosh Nayak,
>
> The patch bdaefbf580cd: "[SCSI] pm8001: Fix bogus interrupt state
> flag issue." from Feb 26, 2012, leads to the following warning:
> drivers/scsi/pm8001/pm8001_hwi.c:2400 mpi_sata_completion()
> error: double unlock 'irq:'
>
>
> } else if (t->uldd_task) {
> - spin_unlock_irqrestore(&t->task_state_lock, flags);
> + spin_unlock_irq(&t->task_state_lock);
> ^^^^^^^^^^^^^^^
> pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
> mb();/* ditto */
> - spin_unlock_irqrestore(&pm8001_ha->lock, flags);
> + spin_unlock_irq(&pm8001_ha->lock);
> ^^^^^^^^^^^^^^^
> It doesn't make sense to enable IRQs twice. I'm not sure if it should
> be the first or second unlock which enables them.
>
> t->task_done(t);
> - spin_lock_irqsave(&pm8001_ha->lock, flags);
> + spin_lock_irq(&pm8001_ha->lock);
> } else if (!t->uldd_task) {
> - spin_unlock_irqrestore(&t->task_state_lock, flags);
> + spin_unlock_irq(&t->task_state_lock);
> ^^^^^^^^^^^^^^^
> pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
> mb();/*ditto*/
> - spin_unlock_irqrestore(&pm8001_ha->lock, flags);
> + spin_unlock_irq(&pm8001_ha->lock);
> ^^^^^^^^^^^^^^^
> Same thing again.
>
> t->task_done(t);
> - spin_lock_irqsave(&pm8001_ha->lock, flags);
> + spin_lock_irq(&pm8001_ha->lock);
> }
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [SCSI] pm8001: Fix bogus interrupt state flag issue.
2012-03-01 14:24 ` santosh prasad nayak
@ 2012-03-01 14:37 ` Dan Carpenter
2012-03-01 14:41 ` santosh prasad nayak
0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2012-03-01 14:37 UTC (permalink / raw)
To: santosh prasad nayak; +Cc: Jack Wang, linux-scsi
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
On Thu, Mar 01, 2012 at 07:54:57PM +0530, santosh prasad nayak wrote:
> The warnings are there since from the beginning.
> Even before my fix.
>
> There are two locks:
> 1. pm8001_ha->lock
> 2. t->task_state_lock
>
Yes. But IRQs are either enabled or disabled for the CPU. You
can't enable them twice.
In this case we enable them in the first call to unlock and the
second call doesn't do anything. So possibly the current behavior
is correct and we should change the second unlock or possibly the
current behavior is wrong and we should change the first unlock.
But actually the email was more of just a form letter. Perhaps Jack
knows what to do here...
regards,
dan carpenter
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [SCSI] pm8001: Fix bogus interrupt state flag issue.
2012-03-01 14:37 ` Dan Carpenter
@ 2012-03-01 14:41 ` santosh prasad nayak
0 siblings, 0 replies; 5+ messages in thread
From: santosh prasad nayak @ 2012-03-01 14:41 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Jack Wang, linux-scsi
t->task_state_lock can be changed to simple spin lock instead of 'irq
spin lock'
Initially I thought to do so. But could not get the intention of the
developer why he used
an irq lock there. Hence left it unchanged. Just changed from 'irqsave
spin lock' to 'irq spin lock'
regard
santosh
On Thu, Mar 1, 2012 at 8:07 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Thu, Mar 01, 2012 at 07:54:57PM +0530, santosh prasad nayak wrote:
>> The warnings are there since from the beginning.
>> Even before my fix.
>>
>> There are two locks:
>> 1. pm8001_ha->lock
>> 2. t->task_state_lock
>>
>
> Yes. But IRQs are either enabled or disabled for the CPU. You
> can't enable them twice.
>
> In this case we enable them in the first call to unlock and the
> second call doesn't do anything. So possibly the current behavior
> is correct and we should change the second unlock or possibly the
> current behavior is wrong and we should change the first unlock.
>
> But actually the email was more of just a form letter. Perhaps Jack
> knows what to do here...
>
> regards,
> dan carpenter
>
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [SCSI] pm8001: Fix bogus interrupt state flag issue.
2012-03-01 14:22 [SCSI] pm8001: Fix bogus interrupt state flag issue Dan Carpenter
2012-03-01 14:24 ` santosh prasad nayak
@ 2012-03-02 1:06 ` Jack Wang
1 sibling, 0 replies; 5+ messages in thread
From: Jack Wang @ 2012-03-02 1:06 UTC (permalink / raw)
To: 'Dan Carpenter', santoshprasadnayak; +Cc: linux-scsi
Dear Dan and Santosh Nayak,
I change task_state_lock to spin_lock is OK. Please feel free to send patch
out.
Thanks.
Jack
>
> Hello Santosh Nayak,
>
> The patch bdaefbf580cd: "[SCSI] pm8001: Fix bogus interrupt state
> flag issue." from Feb 26, 2012, leads to the following warning:
> drivers/scsi/pm8001/pm8001_hwi.c:2400 mpi_sata_completion()
> error: double unlock 'irq:'
>
>
> } else if (t->uldd_task) {
> - spin_unlock_irqrestore(&t->task_state_lock, flags);
> + spin_unlock_irq(&t->task_state_lock);
> ^^^^^^^^^^^^^^^
> pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
> mb();/* ditto */
> - spin_unlock_irqrestore(&pm8001_ha->lock, flags);
> + spin_unlock_irq(&pm8001_ha->lock);
> ^^^^^^^^^^^^^^^
> It doesn't make sense to enable IRQs twice. I'm not sure if it should
> be the first or second unlock which enables them.
>
> t->task_done(t);
> - spin_lock_irqsave(&pm8001_ha->lock, flags);
> + spin_lock_irq(&pm8001_ha->lock);
> } else if (!t->uldd_task) {
> - spin_unlock_irqrestore(&t->task_state_lock, flags);
> + spin_unlock_irq(&t->task_state_lock);
> ^^^^^^^^^^^^^^^
> pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
> mb();/*ditto*/
> - spin_unlock_irqrestore(&pm8001_ha->lock, flags);
> + spin_unlock_irq(&pm8001_ha->lock);
> ^^^^^^^^^^^^^^^
> Same thing again.
>
> t->task_done(t);
> - spin_lock_irqsave(&pm8001_ha->lock, flags);
> + spin_lock_irq(&pm8001_ha->lock);
> }
>
> regards,
> dan carpenter
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-02 1:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 14:22 [SCSI] pm8001: Fix bogus interrupt state flag issue Dan Carpenter
2012-03-01 14:24 ` santosh prasad nayak
2012-03-01 14:37 ` Dan Carpenter
2012-03-01 14:41 ` santosh prasad nayak
2012-03-02 1:06 ` Jack Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox