Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752399AbbFZRGb (ORCPT ); Fri, 26 Jun 2015 13:06:31 -0400 Received: from mx0b-0016ce01.pphosted.com ([67.231.156.153]:11675 "EHLO mx0b-0016ce01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752086AbbFZRGX convert rfc822-to-8bit (ORCPT ); Fri, 26 Jun 2015 13:06:23 -0400 From: Himanshu Madhani To: Mauricio Faria de Oliveira , linux-scsi CC: linux-kernel , "JBottomley@parallels.com" , Dept-Eng QLA2xxx Upstream , "cascardo@debian.org" Subject: Re: [PATCH] [RESEND] qla2xxx: prevent board_disable from running during EEH Thread-Topic: [PATCH] [RESEND] qla2xxx: prevent board_disable from running during EEH Thread-Index: AQHQsC3vAW9WBVf96UCuO78VZvMq2p2/BGYA Date: Fri, 26 Jun 2015 17:06:08 +0000 Message-ID: References: <1430395985-17101-1-git-send-email-cascardo@linux.vnet.ibm.com> <558D7EF7.30104@linux.vnet.ibm.com> In-Reply-To: <558D7EF7.30104@linux.vnet.ibm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.9.131030 x-originating-ip: [10.1.4.10] disclaimer: bypass Content-Type: text/plain; charset="us-ascii" Content-ID: <1611A98BF90EB14CBCEFF334BA56095C@qlogic.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7843 signatures=670598 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1506180000 definitions=main-1506260248 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2486 Lines: 68 On 6/26/15, 9:33 AM, "Mauricio Faria de Oliveira" wrote: >Commit f3ddac1918fe963bcbf8d407a3a3c0881b47248b ("[SCSI] qla2xxx: >Disable adapter when we encounter a PCI disconnect.") has introduced a >code that disables the board, releasing some resources, when reading >0xffffffff. > >In case this happens when there is an EEH, this read will trigger EEH >detection and set PCI channel offline. EEH will be able to recover the >card from this state by doing a reset, so it's a better option than >simply disabling the card. > >Since eeh_check_failure will mark the channel as offline before >returning the read value, in case there really was an EEH, we can simply >check for pci_channel_offline, preventing the board_disable code from >running if it's true. > >Without this patch, EEH code will try to access those same resources >that board_disable will try to free. This race can cause EEH recovery to >fail. > >[ 504.370577] EEH: Notify device driver to resume >[ 504.370580] qla2xxx [0001:07:00.0]-9002:2: The device failed to >resume I/O from slot/link_reset. > >Signed-off-by: Thadeu Lima de Souza Cascardo >Cc: >Cc: >--- > drivers/scsi/qla2xxx/qla_isr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/drivers/scsi/qla2xxx/qla_isr.c >b/drivers/scsi/qla2xxx/qla_isr.c >index a04a1b1..8132926 100644 >--- a/drivers/scsi/qla2xxx/qla_isr.c >+++ b/drivers/scsi/qla2xxx/qla_isr.c >@@ -116,7 +116,7 @@ bool > qla2x00_check_reg32_for_disconnect(scsi_qla_host_t *vha, uint32_t reg) > { > /* Check for PCI disconnection */ >- if (reg == 0xffffffff) { >+ if (reg == 0xffffffff && !pci_channel_offline(vha->hw->pdev)) { > if (!test_and_set_bit(PFLG_DISCONNECTED, &vha->pci_flags) && > !test_bit(PFLG_DRIVER_REMOVING, &vha->pci_flags) && > !test_bit(PFLG_DRIVER_PROBING, &vha->pci_flags)) { >-- >1.7.10.4 > > Looks good. Acked-by: Himanshu Madhani > >-- >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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/