netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] rds_rdma: don't assume infiniband device is PCI
@ 2012-01-06 19:27 Venkat Venkatsubra
  0 siblings, 0 replies; 14+ messages in thread
From: Venkat Venkatsubra @ 2012-01-06 19:27 UTC (permalink / raw)
  To: roland
  Cc: netdev, rds-devel, Jes.Sorensen, davem, cascardo, dledford,
	linux-kernel


Looks great to me:

Reviewed-by: Roland Dreier <roland@purestorage.com>
Acked-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] rds_rdma: don't assume infiniband device is PCI
@ 2012-01-04 22:03 Thadeu Lima de Souza Cascardo
  2012-01-06 17:47 ` Roland Dreier
  0 siblings, 1 reply; 14+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2012-01-04 22:03 UTC (permalink / raw)
  To: venkat.x.venkatsubra
  Cc: davem, netdev, linux-kernel, Thadeu Lima de Souza Cascardo,
	dledford, Jes.Sorensen, rds-devel

RDS code assumes that the struct ib_device dma_device member, which is a
pointer, points to a struct device embedded in a struct pci_dev.

This is not the case for ehca, for example, which is a OF driver, and
makes dma_device point to a struct device embedded in a struct
platform_device.

This will make the system crash when rds_rdma is loaded in a system
with ehca, since it will try to access the bus member of a non-existent
struct pci_dev.

The only reason rds_rdma uses the struct pci_dev is to get the NUMA node
the device is attached to. Using dev_to_node for that is much better,
since it won't assume which bus the infiniband is attached to.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: dledford@redhat.com
Cc: Jes.Sorensen@redhat.com
Cc: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Cc: rds-devel@oss.oracle.com
---
 net/rds/ib.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/rds/ib.h b/net/rds/ib.h
index edfaaaf..8d2b3d5 100644
--- a/net/rds/ib.h
+++ b/net/rds/ib.h
@@ -186,8 +186,7 @@ struct rds_ib_device {
 	struct work_struct	free_work;
 };
 
-#define pcidev_to_node(pcidev) pcibus_to_node(pcidev->bus)
-#define ibdev_to_node(ibdev) pcidev_to_node(to_pci_dev(ibdev->dma_device))
+#define ibdev_to_node(ibdev) dev_to_node(ibdev->dma_device)
 #define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev)
 
 /* bits for i_ack_flags */
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-01-13 21:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <ed54708d-990e-4c8f-8057-50a70f93d3d8@default>
2012-01-05 17:05 ` [PATCH] rds_rdma: don't assume infiniband device is PCI Thadeu Lima de Souza Cascardo
2012-01-05 18:57   ` David Miller
2012-01-06 15:57   ` Thadeu Lima de Souza Cascardo
2012-01-06 17:43     ` Thadeu Lima de Souza Cascardo
2012-01-06 19:27 Venkat Venkatsubra
  -- strict thread matches above, loose matches on Subject: below --
2012-01-04 22:03 Thadeu Lima de Souza Cascardo
2012-01-06 17:47 ` Roland Dreier
2012-01-06 17:49   ` Roland Dreier
2012-01-13 18:17     ` Thadeu Lima de Souza Cascardo
2012-01-13 18:25       ` David Miller
2012-01-13 18:52         ` Thadeu Lima de Souza Cascardo
2012-01-13 21:12           ` David Miller
2012-01-13 21:21             ` Thadeu Lima de Souza Cascardo
2012-01-13 18:35       ` Roland Dreier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).