From patchwork Mon May 27 22:43:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 246664 X-Patchwork-Delegate: davem@davemloft.net 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 E5ECB2C007A for ; Tue, 28 May 2013 08:43:27 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757940Ab3E0Wn0 (ORCPT ); Mon, 27 May 2013 18:43:26 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:54817 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752201Ab3E0Wn0 (ORCPT ); Mon, 27 May 2013 18:43:26 -0400 Received: by mail-lb0-f173.google.com with SMTP id t10so7170826lbi.18 for ; Mon, 27 May 2013 15:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=O3hhiHBAhYzY1hGtUwLCsTRV2IHUpEGizuQ7TgtqPbY=; b=J0Tum+UN/4QJQFIoHSLNEnEGSL+CGR7oyBmujJpfw8DLopby46kg7rzINaq/SioL4Y 5RdSAxKIcI96uh30bnkQ6KMTrn6z/jdsikgDUQGUGTdxGIpuYUiv94uFaaElpRR6n1J9 A989GFwqhZ2j6x62lHG7kOGW/fwM+G9rcFiKyIVapiWaNB1mVDBJQfW4U6de5jHnOL0z w2wCzAYeb3dmcUOtb/tPb2SWiy8jPbvwX6Yv2b54UXOreuxt5hoil9CQCuvdXfvzhDow t3WHz23ZGFizfz122gXd9kHSXhMVYEOtv8HYGCSnkSN1bxJoONui85LIscrICEd2ugUR tHcg== X-Received: by 10.152.87.69 with SMTP id v5mr15448500laz.24.1369694604393; Mon, 27 May 2013 15:43:24 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-145-214.pppoe.mtu-net.ru. [91.76.145.214]) by mx.google.com with ESMTPSA id e3sm12273227lbf.17.2013.05.27.15.43.22 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 15:43:23 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: linux-ide@vger.kernel.org, tj@kernel.org Subject: [PATCH 1/3] sata_rcar: kill superfluous code in sata_rcar_bmdma_fill_sg() Date: Tue, 28 May 2013 02:43:23 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: linux-sh@vger.kernel.org References: <201305280238.17867.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201305280238.17867.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201305280243.23983.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQlW+9gSl1a+21uNsGSPuBB6FRVsrQEb+i670dPsWGB9NWSomaSziyNpgzNZyJE1dnZVnuum Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org I've modified sata_rcar_bmdma_fill_sg() to take care of splitting long scatter/ gather segments due to the descriptor table transfer counter being only 28 bits wide (bit 1 to bit 28) but that was in vain as even if 'sata_rcar_sht' specified a correct 'dma_boundary' field, the DMA and block layers would have split the S/G segments on the necassary boundaries. Since the driver uses ATA_BMDMA_SHT() to initilaize 'sata_rcar_sht', the boundary is much smaller, only 0xFFFF, so the code I've added is even more useless, and it's better to just remove it. Signed-off-by: Sergei Shtylyov --- drivers/ata/sata_rcar.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: libata/drivers/ata/sata_rcar.c =================================================================== --- libata.orig/drivers/ata/sata_rcar.c +++ libata/drivers/ata/sata_rcar.c @@ -474,11 +474,10 @@ static void sata_rcar_bmdma_fill_sg(stru struct ata_port *ap = qc->ap; struct ata_bmdma_prd *prd = ap->bmdma_prd; struct scatterlist *sg; - unsigned int si, pi; + unsigned int si; - pi = 0; for_each_sg(qc->sg, sg, qc->n_elem, si) { - u32 addr, sg_len, len; + u32 addr, sg_len; /* * Note: h/w doesn't support 64-bit, so we unconditionally @@ -487,24 +486,13 @@ static void sata_rcar_bmdma_fill_sg(stru addr = (u32)sg_dma_address(sg); sg_len = sg_dma_len(sg); - /* H/w transfer count is only 29 bits long, let's be careful */ - while (sg_len) { - len = sg_len; - if (len > 0x1ffffffe) - len = 0x1ffffffe; - - prd[pi].addr = cpu_to_le32(addr); - prd[pi].flags_len = cpu_to_le32(len); - VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", pi, addr, len); - - pi++; - sg_len -= len; - addr += len; - } + prd[si].addr = cpu_to_le32(addr); + prd[si].flags_len = cpu_to_le32(sg_len); + VPRINTK("PRD[%u] = (0x%X, 0x%X)\n", si, addr, sg_len); } /* end-of-table flag */ - prd[pi - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND); + prd[si - 1].addr |= cpu_to_le32(SATA_RCAR_DTEND); } static void sata_rcar_qc_prep(struct ata_queued_cmd *qc)