Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp320688pxa; Thu, 27 Aug 2020 03:21:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUG+3B4UZKBK+MqxtBPiOkA3i51RefdScFrv01wg36e3aUmXHZoRqWs68ae2+tvX2n5/J9 X-Received: by 2002:a17:906:1986:: with SMTP id g6mr21266672ejd.404.1598523672856; Thu, 27 Aug 2020 03:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598523672; cv=none; d=google.com; s=arc-20160816; b=gZ4SNCmFGKPhJ7vZG7t6umKFbkpapTteRaqnvcTfsECVcxoFhmrEA/RM3cSXMBZy4/ aBMIM8/VcGDHidQGjs46t2hBZb6DApOK6UhILn91RmnQ2Hco70VfIDAgwtl4pXinaqqx z45OKWew/ySwwwkpFEwmcE0hCM36DGxdGBBVFCkzlhvYfPKo8ok8yqGxmG3rIUgMLYLC cx41asByBDh+zZ9EVo7cjFuZClM2e6k9l37NC8IAdyvIEE5nBJLg5J7lCLlJI5C2ACDH GVKd1Sy1W7RURxEguW5j8DZfJQY6uT7rhiKH4cUX1KWH72/hBhQpha58cv0RD6ElLc2s 6/lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=L3GHekg3BYvdxigHFJQh4QcMANM9EpHow3O3uHQFWuY=; b=LRldtHEA3VpNwfoEnkj+fxDy6lvDzdFMKQ/bg6ihpymmxUmWOgwnixWBL9hmiiV0Rm Owsc9+fVhG8kdqVQjFJQoIKHCFntMTVJOvBOmD5kzCGwUsyHQ/Q6KTc8Hxjbp4saiT3c gSWHYfZHpE2bICmpu2ZKROITGv4u3/5XuhCb3A37jMUiJlIrVYVtPtzLkCYHgejmrktV 0MuhtLl81BCKw+z1Pumg4x4806C2g5TzW9JbJrj77Q0XJCGvAyW2+EC2TW1EMHCYGrnU Y08Zuh+wOEraNeuTzYOz6aPae42wV94kTc352b3kzwzdD3vofFhHFuE0I34xOhP+KEW8 HISg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si1201470edw.285.2020.08.27.03.20.50; Thu, 27 Aug 2020 03:21:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728945AbgH0KRX (ORCPT + 99 others); Thu, 27 Aug 2020 06:17:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:58806 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728932AbgH0KRQ (ORCPT ); Thu, 27 Aug 2020 06:17:16 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 3495FAFC1; Thu, 27 Aug 2020 10:17:46 +0000 (UTC) Message-ID: <21cd86f782616fcac25f1a6270a9bd834ec777b7.camel@suse.com> Subject: Re: [PATCH 4/4] qla2xxx: Handle incorrect entry_type entries From: Martin Wilck To: Daniel Wagner , linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Nilesh Javali Date: Thu, 27 Aug 2020 12:17:13 +0200 In-Reply-To: <20200827095829.63871-5-dwagner@suse.de> References: <20200827095829.63871-1-dwagner@suse.de> <20200827095829.63871-5-dwagner@suse.de> Content-Type: text/plain; charset="ISO-8859-15" User-Agent: Evolution 3.36.5 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-08-27 at 11:58 +0200, Daniel Wagner wrote: > It was observed on an ISP8324 16Gb HBA with fw=8.08.203 (d0d5) that > pkt->entry_type was MBX_IOCB_TYPE/0x39 with an sp->type SRB_SCSI_CMD > which is invalid and should not be possible. > > A careful code review of the crash dump didn't reveal any short > comings. Reading the entry_type from the crash dump shows the > expected > value of STATUS_TYPE/0x03 but the call trace shows that > qla24xx_mbx_iocb_entry() is used. > > One possible explanation is when pkt->entry_type is read it doesn't > contain the correct information. That means the driver observes an > data > race by the firmware. > > Signed-off-by: Daniel Wagner > --- > drivers/scsi/qla2xxx/qla_isr.c | 28 ++++++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/qla2xxx/qla_isr.c > b/drivers/scsi/qla2xxx/qla_isr.c > index b787643f5031..0c324e88b189 100644 > --- a/drivers/scsi/qla2xxx/qla_isr.c > +++ b/drivers/scsi/qla2xxx/qla_isr.c > @@ -3392,6 +3392,31 @@ void qla24xx_nvme_ls4_iocb(struct > scsi_qla_host *vha, > sp->done(sp, comp_status); > } > > +static void qla24xx_process_mbx_iocb_response(struct scsi_qla_host > *vha, > + struct rsp_que *rsp, struct sts_entry_24xx *pkt) > +{ > + srb_t *sp; > + > + sp = qla2x00_get_sp_from_handle(vha, rsp->req, pkt); > + if (!sp) > + return; > + > + if (sp->type == SRB_SCSI_CMD || > + sp->type == SRB_NVME_CMD || > + sp->type == SRB_TM_CMD) { > + /* Some firmware version don't update the entry_type > + * correctly. It was observed entry_type contained > + * MBCX_IOCB_TYPE instead of the expected STATUS_TYPE > + * for sp->type SRB_SCSI_CMD, SRB_NVME_CMD or > + * SRB_TM_CMD. > + */ > + qla2x00_status_entry(vha, rsp, pkt); > + return; > + } > + > + qla24xx_mbx_iocb_entry(vha, rsp->req, (struct mbx_24xx_entry > *)pkt); > +} > + > /** > * qla24xx_process_response_queue() - Process response queue > entries. > * @vha: SCSI driver HA context > @@ -3499,8 +3524,7 @@ void qla24xx_process_response_queue(struct > scsi_qla_host *vha, > (struct abort_entry_24xx *)pkt); > break; > case MBX_IOCB_TYPE: > - qla24xx_mbx_iocb_entry(vha, rsp->req, > - (struct mbx_24xx_entry *)pkt); > + qla24xx_process_mbx_iocb_response(vha, rsp, > pkt); > break; > case VP_CTRL_IOCB_TYPE: > qla_ctrlvp_completed(vha, rsp->req, Should we perhaps log an error message when we detect a mismatch between sp->type and entry_type? Regards, Martin