From patchwork Tue Jul 9 20:39:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Myron Stowe X-Patchwork-Id: 2825442 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1DFAC9F7D6 for ; Tue, 9 Jul 2013 20:40:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D48072017C for ; Tue, 9 Jul 2013 20:40:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F3BE20174 for ; Tue, 9 Jul 2013 20:40:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753600Ab3GIUjw (ORCPT ); Tue, 9 Jul 2013 16:39:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2484 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751945Ab3GIUjs (ORCPT ); Tue, 9 Jul 2013 16:39:48 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r69KdkZ6010929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Jul 2013 16:39:46 -0400 Received: from amt.stowe (ovpn-113-108.phx2.redhat.com [10.3.113.108]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r69KdjHk018999; Tue, 9 Jul 2013 16:39:46 -0400 From: Myron Stowe Subject: [PATCH 3/3] [SCSI] megaraid: Remove 64-bit DMA related dead code To: megaraidlinux@lsi.com, JBottomley@parallels.com Cc: linux-scsi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Date: Tue, 09 Jul 2013 14:39:45 -0600 Message-ID: <20130709203945.31676.74315.stgit@amt.stowe> In-Reply-To: <20130709203927.31676.35169.stgit@amt.stowe> References: <20130709203927.31676.35169.stgit@amt.stowe> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 With the driver now setup for default 32-bit DMA capabilities, remove the 64-bit DMA related dead code. Signed-off-by: Myron Stowe --- drivers/scsi/megaraid.c | 45 +++++++++------------------------------------ drivers/scsi/megaraid.h | 1 - 2 files changed, 9 insertions(+), 37 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" 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/megaraid.c b/drivers/scsi/megaraid.c index 316924c..58953ab 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -713,12 +713,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) pthru->cdblen = cmd->cmd_len; memcpy(pthru->cdb, cmd->cmnd, cmd->cmd_len); - if( adapter->has_64bit_addr ) { - mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU64; - } - else { - mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU; - } + mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU; scb->dma_direction = PCI_DMA_FROMDEVICE; @@ -750,16 +745,9 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) * A little hack: 2nd bit is zero for all scsi read * commands and is set for all scsi write commands */ - if( adapter->has_64bit_addr ) { - mbox->m_out.cmd = (*cmd->cmnd & 0x02) ? - MEGA_MBOXCMD_LWRITE64: - MEGA_MBOXCMD_LREAD64 ; - } - else { - mbox->m_out.cmd = (*cmd->cmnd & 0x02) ? - MEGA_MBOXCMD_LWRITE: - MEGA_MBOXCMD_LREAD ; - } + mbox->m_out.cmd = (*cmd->cmnd & 0x02) ? + MEGA_MBOXCMD_LWRITE: + MEGA_MBOXCMD_LREAD ; /* * 6-byte READ(0x08) or WRITE(0x0A) cdb @@ -929,13 +917,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy) channel, target); /* Initialize mailbox */ - if( adapter->has_64bit_addr ) { - mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU64; - } - else { - mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU; - } - + mbox->m_out.cmd = MEGA_MBOXCMD_PASSTHRU; mbox->m_out.xferaddr = scb->pthru_dma_addr; } @@ -1763,7 +1745,7 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len) *len = 0; - if (scsi_sg_count(cmd) == 1 && !adapter->has_64bit_addr) { + if (scsi_sg_count(cmd) == 1) { sg = scsi_sglist(cmd); scb->dma_h_bulkdata = sg_dma_address(sg); *buf = (u32)scb->dma_h_bulkdata; @@ -1772,13 +1754,8 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len) } scsi_for_each_sg(cmd, sg, sgcnt, idx) { - if (adapter->has_64bit_addr) { - scb->sgl64[idx].address = sg_dma_address(sg); - *len += scb->sgl64[idx].length = sg_dma_len(sg); - } else { - scb->sgl[idx].address = sg_dma_address(sg); - *len += scb->sgl[idx].length = sg_dma_len(sg); - } + scb->sgl[idx].address = sg_dma_address(sg); + *len += scb->sgl[idx].length = sg_dma_len(sg); } /* Reset pointer and length fields */ @@ -2076,10 +2053,7 @@ proc_show_config(struct seq_file *m, void *v) if(adapter->flag & BOARD_64BIT) seq_puts(m, "Controller capable of 64-bit memory addressing\n"); - if( adapter->has_64bit_addr ) - seq_puts(m, "Controller using 64-bit memory addressing\n"); - else - seq_puts(m, "Controller is not using 64-bit memory addressing\n"); + seq_puts(m, "Controller is not using 64-bit memory addressing\n"); seq_printf(m, "Base = %08lx, Irq = %d, ", adapter->base, adapter->host->irq); @@ -4471,7 +4445,6 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) /* Set the Mode of addressing to 32 bit */ pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); - adapter->has_64bit_addr = 0; mutex_init(&adapter->int_mtx); init_completion(&adapter->int_waitq); diff --git a/drivers/scsi/megaraid.h b/drivers/scsi/megaraid.h index 4d0ce4e..17e449b 100644 --- a/drivers/scsi/megaraid.h +++ b/drivers/scsi/megaraid.h @@ -827,7 +827,6 @@ typedef struct { #endif - int has_64bit_addr; /* are we using 64-bit addressing */ int support_ext_cdb; int boot_ldrv_enabled; int boot_ldrv;