Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755486AbYGISv4 (ORCPT ); Wed, 9 Jul 2008 14:51:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753431AbYGISvt (ORCPT ); Wed, 9 Jul 2008 14:51:49 -0400 Received: from smtp-vbr11.xs4all.nl ([194.109.24.31]:1387 "EHLO smtp-vbr11.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753296AbYGISvs (ORCPT ); Wed, 9 Jul 2008 14:51:48 -0400 Subject: Re: [PATCH] Mark i2o config broken on 64-bit platforms. From: Miquel van Smoorenburg To: David Howells Cc: akpm@linux-foundation.org, alan@redhat.com, Markus.Lidel@shadowconnect.com, vvs@sw.ru, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org In-Reply-To: <4561.1215612914@redhat.com> References: <20080709113547.19235.15424.stgit@warthog.procyon.org.uk> <4561.1215612914@redhat.com> Content-Type: text/plain Date: Wed, 09 Jul 2008 20:49:41 +0200 Message-Id: <1215629381.18506.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1282 Lines: 35 (apologies for the bouncing mail earlier today, somebody [who _will_ buy us all sushi tomorrow] broke our mail setup ...) On Wed, 2008-07-09 at 15:15 +0100, David Howells wrote: > Miquel van Smoorenburg wrote: > > > second, compiling it gives warnings, but it works, and I bet people are > > using it. > > Maybe, but have you looked at i2o_cfg_passthru()? Take this, for example: > > /* Allocate memory for the transfer */ > p = kmalloc(sg_size, GFP_KERNEL); > ... > //TODO 64bit fix > sg[i].addr_bus = virt_to_bus(p); > > That looks distinctly dodgy. virt_to_bus() returns a 64-bit address, and as > far as I know you may not assume that it will return a 32-bit address. You're > taking the bus-address of a piece of RAM, but there may be more than 4GB of > RAM in the system. Oh dear, that's indeed bad. Looks like that should use i2o_dma_alloc() instead. (drivers/scsi/dpt_i2o.c gets this right). (and what's with the (unlocked!) pci_set_dma_mask() flipping in i2o_dma_alloc() ? ) Mike. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/