Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262892AbVDAWF7 (ORCPT ); Fri, 1 Apr 2005 17:05:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262895AbVDAUyR (ORCPT ); Fri, 1 Apr 2005 15:54:17 -0500 Received: from webmail.topspin.com ([12.162.17.3]:35887 "EHLO exch-1.topspincom.com") by vger.kernel.org with ESMTP id S262892AbVDAUvF (ORCPT ); Fri, 1 Apr 2005 15:51:05 -0500 Cc: linux-kernel@vger.kernel.org, openib-general@openib.org Subject: [PATCH][5/27] IB/mthca: allow unaligned memory regions In-Reply-To: <2005411249.dKg4ijljsqXo1Rt6@topspin.com> X-Mailer: Roland's Patchbomber Date: Fri, 1 Apr 2005 12:49:52 -0800 Message-Id: <2005411249.cEJmE9mY2eziJTR6@topspin.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII To: akpm@osdl.org Content-Transfer-Encoding: 7BIT From: Roland Dreier X-OriginalArrivalTime: 01 Apr 2005 20:49:52.0481 (UTC) FILETIME=[5A507D10:01C536FC] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1006 Lines: 26 From: Michael S. Tsirkin The first buffer of a memory region is not required to be page-aligned, so don't return an error if it's not. Signed-off-by: Michael S. Tsirkin Signed-off-by: Roland Dreier --- linux-export.orig/drivers/infiniband/hw/mthca/mthca_provider.c 2005-04-01 12:38:20.839437009 -0800 +++ linux-export/drivers/infiniband/hw/mthca/mthca_provider.c 2005-04-01 12:38:21.926201103 -0800 @@ -494,7 +494,7 @@ mask = 0; total_size = 0; for (i = 0; i < num_phys_buf; ++i) { - if (buffer_list[i].addr & ~PAGE_MASK) + if (i != 0 && buffer_list[i].addr & ~PAGE_MASK) return ERR_PTR(-EINVAL); if (i != 0 && i != num_phys_buf - 1 && (buffer_list[i].size & ~PAGE_MASK)) - 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/