[RFC] SCSI target for IBM Power5 LPAR
Anton Blanchard
anton at samba.org
Wed Sep 7 12:59:32 EST 2005
Hi Dave,
> This device driver provides the SCSI target side of the "virtual
> SCSI" on IBM Power5 systems. The initiator side has been in mainline
> for a while now (drivers/scsi/ibmvscsi/ibmvscsi.c.) Targets already
> exist for AIX and OS/400.
Good stuff. Got a couple of small suggestions.
+/* Allocate a buffer with a dma_address. Don't use dma_alloc_coherent
+ * since that uses GFP_ATOMIC internally and we can tollerate a delay
+ */
+static void *alloc_coherent_buffer(struct server_adapter *adapter, size_t size,
+ dma_addr_t *dma_handle)
+{
+ void *buffer = kmalloc(size, GFP_KERNEL);
+
+ if (buffer) {
+ *dma_handle = dma_map_single(adapter->dev, buffer, size,
+ DMA_BIDIRECTIONAL);
+
+ if (dma_mapping_error(*dma_handle)) {
+ kfree(buffer);
+ buffer = NULL;
+ }
+ }
+
+ return buffer;
+}
This should be fixed in mainline, on ppc64 we no longer build the dma_*
ops on top of the pci_* ops. This means we actually look at the flags :)
+ adapter->max_sectors = MAX_SECTORS;
Does this mean we are limited to 128kB transfers? Would it be OK to
bump the default?
Anton
More information about the Linuxppc64-dev
mailing list