<html><head></head><body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 5, 2021, at 2:48 AM, angkery <<a href="mailto:angkery@163.com" class="">angkery@163.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">From: Junlin Yang <<a href="mailto:yangjunlin@yulong.com" class="">yangjunlin@yulong.com</a>><br class=""><br class="">ibmvnic_remove locks multiple spinlocks while disabling interrupts:<br class="">spin_lock_irqsave(&adapter->state_lock, flags);<br class="">spin_lock_irqsave(&adapter->rwi_lock, flags);<br class=""><br class="">As reported by coccinelle, the second _irqsave() overwrites the value<br class="">saved in 'flags' by the first _irqsave(), therefore when the second<br class="">_irqrestore() comes,the value in 'flags' is not valid,the value saved<br class="">by the first _irqsave() has been lost.<br class="">This likely leads to IRQs remaining disabled. So remove the second<br class="">_irqsave():<br class="">spin_lock_irqsave(&adapter->state_lock, flags);<br class="">spin_lock(&adapter->rwi_lock);<br class=""><br class="">Generated by: ./scripts/coccinelle/locks/flags.cocci<br class="">./drivers/net/ethernet/ibm/ibmvnic.c:5413:1-18:<br class="">ERROR: nested lock+irqsave that reuses flags from line 5404.<br class=""><br class="">Fixes: 4a41c421f367 ("ibmvnic: serialize access to work queue on remove")<br class="">Signed-off-by: Junlin Yang <<a href="mailto:yangjunlin@yulong.com" class="">yangjunlin@yulong.com</a>><br class="">---<br class=""></div></div></blockquote><div><br class=""></div><div>Acked-by: Lijun Pan <<a href="mailto:ljp@linux.ibm" class="">ljp@linux.ibm</a>.com></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">Changes in v1:<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>a.According to Christophe Leroy's explanation, update the commit information.<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>b.Add fixes tags.<br class=""><br class=""> drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--<br class=""> 1 file changed, 2 insertions(+), 2 deletions(-)<br class=""><br class="">diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c<br class="">index 2464c8a..a52668d 100644<br class="">--- a/drivers/net/ethernet/ibm/ibmvnic.c<br class="">+++ b/drivers/net/ethernet/ibm/ibmvnic.c<br class="">@@ -5408,9 +5408,9 @@ static void ibmvnic_remove(struct vio_dev *dev)<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span> * after setting state, so __ibmvnic_reset() which is called<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span> * from the flush_work() below, can make progress.<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span> */<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>spin_lock_irqsave(&adapter->rwi_lock, flags);<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>spin_lock(&adapter->rwi_lock);<br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>adapter->state = VNIC_REMOVING;<br class="">-<span class="Apple-tab-span" style="white-space:pre"> </span>spin_unlock_irqrestore(&adapter->rwi_lock, flags);<br class="">+<span class="Apple-tab-span" style="white-space:pre"> </span>spin_unlock(&adapter->rwi_lock);<br class=""><br class=""> <span class="Apple-tab-span" style="white-space:pre"> </span>spin_unlock_irqrestore(&adapter->state_lock, flags);<br class=""><br class="">-- <br class="">1.9.1<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></div></div></body></html>