Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752880AbbFZVYf (ORCPT ); Fri, 26 Jun 2015 17:24:35 -0400 Received: from p01c12o149.mxlogic.net ([208.65.145.72]:36287 "EHLO p01c12o149.mxlogic.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752434AbbFZVY1 (ORCPT ); Fri, 26 Jun 2015 17:24:27 -0400 X-MXL-Hash: 558dc30b3c8c6fef-5767a5346716060889efe56da915c40c0cfe8889 X-MXL-Hash: 558dc30a554baab7-6247d0b519d20a69771a68d1baf237091bf80828 Message-ID: <558DC300.3020004@stratus.com> Date: Fri, 26 Jun 2015 17:24:16 -0400 From: Joe Lawrence User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mauricio Faria de Oliveira , CC: , , , Subject: Re: [PATCH] [RESEND] qla2xxx: prevent board_disable from running during EEH 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> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [134.111.199.152] X-AnalysisOut: [v=2.1 cv=U7qGDIbu c=1 sm=1 tr=0 a=o2bo05G+d1rlxuoNbFVhCw==] X-AnalysisOut: [:117 a=o2bo05G+d1rlxuoNbFVhCw==:17 a=uelBKuKpAAAA:8 a=YlVT] X-AnalysisOut: [AMxIAAAA:8 a=hTJJpgObMeYA:10 a=CdzKgOd8jloA:10 a=BLceEmwcH] X-AnalysisOut: [owA:10 a=N659UExz7-8A:10 a=XAFQembCKUMA:10 a=VnNF1IyMAAAA:] X-AnalysisOut: [8 a=xNf9USuDAAAA:8 a=2x0i829HlcbGQHohe5kA:9 a=pILNOxqGKmIA] X-AnalysisOut: [:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2015062613); S=0.200(2014051901)] X-MAIL-FROM: X-SOURCE-IP: [134.111.1.18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2938 Lines: 73 On 06/26/2015 12:33 PM, 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)) { Hi Mauricio, Re: signed-off-by chain -- I believe if you are (re)sending another person's patch, you will need a: "From: Thadeu Lima de Souza Cascardo " tag at the top of the message body to retain original authorship and then your own: "Signed-off-by: Mauricio Faria de Oliveira " tag below Thadeu's since the patch has passed through you. Re: the patch -- I did some work last year to harden board_disable against various races, but without having EEH hardware available, I was uncertain about EEH behavior. For example: pci_read EEH -> marks channel offline pci_read returns ~0 When do the EEH error handler callbacks run? Thanks, -- Joe -- 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/