From patchwork Tue Dec 1 07:08:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 39880 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 65F51B7C89 for ; Tue, 1 Dec 2009 18:08:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753313AbZLAHI1 (ORCPT ); Tue, 1 Dec 2009 02:08:27 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753330AbZLAHI1 (ORCPT ); Tue, 1 Dec 2009 02:08:27 -0500 Received: from ozlabs.org ([203.10.76.45]:43778 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753313AbZLAHI0 (ORCPT ); Tue, 1 Dec 2009 02:08:26 -0500 Received: by ozlabs.org (Postfix, from userid 1030) id A8B621007D2; Tue, 1 Dec 2009 18:08:32 +1100 (EST) To: CC: , , From: Benjamin Herrenschmidt Date: Tue, 01 Dec 2009 18:08:32 +1100 Subject: [PATCH 2/5] powerpc/macio: Add dma_parms support to macio Message-Id: <20091201070832.A8B621007D2@ozlabs.org> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This adds dma_parms to macio devices and initializes them with default values. This will allow pata_macio to setup the appropriate max segment size for the block layer. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/macio.h | 1 + drivers/macintosh/macio_asic.c | 5 +++++ 2 files changed, 6 insertions(+) -- 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 --- linux-work.orig/arch/powerpc/include/asm/macio.h 2009-11-27 14:38:05.000000000 +1100 +++ linux-work/arch/powerpc/include/asm/macio.h 2009-11-27 14:38:20.000000000 +1100 @@ -39,6 +39,7 @@ struct macio_dev struct macio_bus *bus; /* macio bus this device is on */ struct macio_dev *media_bay; /* Device is part of a media bay */ struct of_device ofdev; + struct device_dma_parameters dma_parms; /* ide needs that */ int n_resources; struct resource resource[MACIO_DEV_COUNT_RESOURCES]; int n_interrupts; Index: linux-work/drivers/macintosh/macio_asic.c =================================================================== --- linux-work.orig/drivers/macintosh/macio_asic.c 2009-11-27 14:39:24.000000000 +1100 +++ linux-work/drivers/macintosh/macio_asic.c 2009-11-27 16:37:39.000000000 +1100 @@ -379,6 +379,11 @@ static struct macio_dev * macio_add_one_ dev->ofdev.dev.parent = parent; dev->ofdev.dev.bus = &macio_bus_type; dev->ofdev.dev.release = macio_release_dev; + dev->ofdev.dev.dma_parms = &dev->dma_parms; + + /* Standard DMA paremeters */ + dma_set_max_seg_size(&dev->ofdev.dev, 65536); + dma_set_seg_boundary(&dev->ofdev.dev, 0xffffffff); #ifdef CONFIG_PCI /* Set the DMA ops to the ones from the PCI device, this could be