From patchwork Fri Jun 7 16:23:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Myron Stowe X-Patchwork-Id: 249756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CC1D12C00A6 for ; Sat, 8 Jun 2013 02:24:05 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756043Ab3FGQXw (ORCPT ); Fri, 7 Jun 2013 12:23:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756784Ab3FGQXu (ORCPT ); Fri, 7 Jun 2013 12:23:50 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r57GNmth008878 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Jun 2013 12:23:48 -0400 Received: from amt.stowe (ovpn-113-153.phx2.redhat.com [10.3.113.153]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r57GNlP4002400; Fri, 7 Jun 2013 12:23:47 -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: Fri, 07 Jun 2013 10:23:47 -0600 Message-ID: <20130607162347.11205.68121.stgit@amt.stowe> In-Reply-To: <20130607162329.11205.95093.stgit@amt.stowe> References: <20130607162329.11205.95093.stgit@amt.stowe> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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;