Commit Graph

7 Commits

Author SHA1 Message Date
Nikunj A Dadhania 8b23f3fd8a pci: add byte read/write helper routines
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-02-08 16:40:38 +11:00
Alexey Kardashevskiy 8d96fe983f helpers: Fix SLOF_alloc_mem_aligned to meet callers expectation
Every caller of SLOF_alloc_mem_aligned() assumes the size is the first
argument while it is not.

This switches align and size and fixes random memory corruptions.

This is grep for SLOF_alloc_mem_aligned with this patch applied:

include/helpers.h|27| extern void *SLOF_alloc_mem_aligned(long size, long align);
lib/libveth/veth.c|103| buffer_list = SLOF_alloc_mem_aligned(8192, 4096);
lib/libveth/veth.c|105| rx_queue = SLOF_alloc_mem_aligned(rx_queue_len, 16);
lib/libvirtio/virtio-net.c|101| vq[i].desc = SLOF_alloc_mem_aligned(virtio_vring_size(vq[i].size), 4096);
slof/helpers.c|70| void *SLOF_alloc_mem_aligned(long size, long align)

Reviewed-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2015-03-13 20:06:46 +11:00
Avik Sil 5046c29b5c Add SLOF usleep wrapper
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 11:59:33 +05:30
Avik Sil 89dee020cf Add SLOF pci wrapper functions
Signed-off-by: Avik Sil <aviksil@linux.vnet.ibm.com>
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
2013-10-04 11:58:51 +05:30
Benjamin Herrenschmidt a0236ff1b1 Use a global definition of sync() and mb()
For memory barriers accross the board. Also move the compiler barrier
to cpu.h

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2013-07-25 13:54:40 +10:00
Nikunj A Dadhania d7354e2724 usb: unmap buffers
Clean up all the dma allocated buffers and remove their mappings.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:23 +05:30
Nikunj A Dadhania 3ee6dcc875 usb-slof: forth support routines for C
Code inherited from libusb code written by former SLOF team

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Acked-by: Thomas Huth <thuth@linux.vnet.ibm.com>
2013-07-24 14:46:22 +05:30