From patchwork Fri Mar 19 04:47:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 86875 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2J4l1kt016568 for ; Fri, 19 Mar 2010 04:47:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751139Ab0CSErA (ORCPT ); Fri, 19 Mar 2010 00:47:00 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:57141 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751087Ab0CSErA (ORCPT ); Fri, 19 Mar 2010 00:47:00 -0400 Received: by gyg8 with SMTP id 8so1407456gyg.19 for ; Thu, 18 Mar 2010 21:46:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=tM1g1oRpDg2jzjI0kK0DLg7QvJ3p6qroB5hz/1xWHKY=; b=SD1rKsPXTXXwm+cUY7HRk6VyPDNa5CPHKTNAhPdBsWnEOoi5o6Ir+ZOBd0y2VTKqkA T0CwSaMMjDIt/4ycFjzeoisE23jmkjbSzmKIeutgXs1hFZAVIff5E/mGPMg8QJKOmSqG sR4xnsvHn5m9rwQawL4yTZw96NMdlXN43XQJY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=IVR3vJxBvrAFYIcBX0Bc6gLThymPvCDIWaDMa1Mlq5cfTQVOB6ZsrpsZCoWrmERBNF YW1Cg5oyQCMRgW+0FomCNVawHbdjDgjFbnGn4mRjaNRa6jiWyxtpgVdxUzoy4dzbv2av pHcO9iFy6P5/T0ObGGnIV3ZBRBWxizmr36ylo= Received: by 10.101.186.8 with SMTP id n8mr6099482anp.229.1268974019007; Thu, 18 Mar 2010 21:46:59 -0700 (PDT) Received: from [127.0.0.1] (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id 15sm494731gxk.6.2010.03.18.21.46.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 18 Mar 2010 21:46:58 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, dan.j.williams@intel.com, iwamatsu@nigauri.org, g.liakhovetski@gmx.de Date: Fri, 19 Mar 2010 13:47:01 +0900 Message-Id: <20100319044701.17051.77755.sendpatchset@t400s> In-Reply-To: <20100319044630.17051.16445.sendpatchset@t400s> References: <20100319044630.17051.16445.sendpatchset@t400s> Subject: [PATCH 03/05] serial: sh-sci: Use sg_dma_len() and sg_dma_address() Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 19 Mar 2010 04:47:02 +0000 (UTC) --- 0003/drivers/serial/sh-sci.c +++ work/drivers/serial/sh-sci.c 2010-03-18 23:21:13.000000000 +0900 @@ -917,10 +917,10 @@ static void sci_dma_tx_complete(void *ar spin_lock_irqsave(&port->lock, flags); - xmit->tail += s->sg_tx.length; + xmit->tail += sg_dma_len(&s->sg_tx); xmit->tail &= UART_XMIT_SIZE - 1; - port->icount.tx += s->sg_tx.length; + port->icount.tx += sg_dma_len(&s->sg_tx); async_tx_ack(s->desc_tx); s->cookie_tx = -EINVAL; @@ -1135,14 +1135,13 @@ static void work_fn_tx(struct work_struc */ spin_lock_irq(&port->lock); sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); - sg->dma_address = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + + sg_dma_address(sg) = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + sg->offset; - sg->length = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), + sg_dma_len(sg) = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE)); - sg->dma_length = sg->length; spin_unlock_irq(&port->lock); - BUG_ON(!sg->length); + BUG_ON(!sg_dma_len(sg)); desc = chan->device->device_prep_slave_sg(chan, sg, s->sg_len_tx, DMA_TO_DEVICE, @@ -1343,8 +1342,7 @@ static void sci_request_dma(struct uart_ sg_init_table(sg, 1); sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, (int)buf[i] & ~PAGE_MASK); - sg->dma_address = dma[i]; - sg->dma_length = sg->length; + sg_dma_address(sg) = dma[i]; } INIT_WORK(&s->work_rx, work_fn_rx);