From patchwork Thu Apr 16 05:16:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 6223711 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CEB4F9F1C4 for ; Thu, 16 Apr 2015 05:16:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02D432024D for ; Thu, 16 Apr 2015 05:16:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0390F2014A for ; Thu, 16 Apr 2015 05:16:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751282AbbDPFQE (ORCPT ); Thu, 16 Apr 2015 01:16:04 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:54222 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbbDPFQD (ORCPT ); Thu, 16 Apr 2015 01:16:03 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 484208EE233; Wed, 15 Apr 2015 22:16:02 -0700 (PDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vSgLWwcxBLqj; Wed, 15 Apr 2015 22:16:02 -0700 (PDT) Received: from [153.66.254.242] (unknown [50.46.149.214]) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id E59A38EE1C1; Wed, 15 Apr 2015 22:16:01 -0700 (PDT) Message-ID: <1429161361.2608.4.camel@HansenPartnership.com> Subject: Re: mvsas panics and dies when attached to a port extender on newer kernels From: James Bottomley To: Adam Talbot Cc: linux-scsi@vger.kernel.org Date: Wed, 15 Apr 2015 22:16:01 -0700 In-Reply-To: References: <1429046165.2209.54.camel@HansenPartnership.com> X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, 2015-04-14 at 14:41 -0700, Adam Talbot wrote: > Removing the sas expander and attaching the SATA drives directly works > just fine. I had to limp along with the drives direct attached for a > while, while debugging. Well, that narrows it down. It looks like there's a longstanding bug in mvs_task_prep_ata() where the physical PHY field is populated by taking an index through the HBA phy table. This field is ignored for STP but the phy table is too small and it uses the expander phy number to index it (hence the GPF as we fall off the end of the phy table trying to dereference sas_phy->id). This should fix the problem. James --- -- 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 diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index 2d5ab6d..454536c 100644 --- a/drivers/scsi/mvsas/mv_sas.c +++ b/drivers/scsi/mvsas/mv_sas.c @@ -441,14 +441,11 @@ static u32 mvs_get_ncq_tag(struct sas_task *task, u32 *tag) static int mvs_task_prep_ata(struct mvs_info *mvi, struct mvs_task_exec_info *tei) { - struct sas_ha_struct *sha = mvi->sas; struct sas_task *task = tei->task; struct domain_device *dev = task->dev; struct mvs_device *mvi_dev = dev->lldd_dev; struct mvs_cmd_hdr *hdr = tei->hdr; struct asd_sas_port *sas_port = dev->port; - struct sas_phy *sphy = dev->phy; - struct asd_sas_phy *sas_phy = sha->sas_phy[sphy->number]; struct mvs_slot_info *slot; void *buf_prd; u32 tag = tei->tag, hdr_tag; @@ -468,7 +465,7 @@ static int mvs_task_prep_ata(struct mvs_info *mvi, slot->tx = mvi->tx_prod; del_q = TXQ_MODE_I | tag | (TXQ_CMD_STP << TXQ_CMD_SHIFT) | - (MVS_PHY_ID << TXQ_PHY_SHIFT) | + ((sas_port->phy_mask & TXQ_PHY_MASK) << TXQ_PHY_SHIFT) | (mvi_dev->taskfileset << TXQ_SRS_SHIFT); mvi->tx[mvi->tx_prod] = cpu_to_le32(del_q);