Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136481916
D41728.id126877.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D41728.id126877.diff
View Options
Index: sys/dev/hyperv/vmbus/vmbus.c
===================================================================
--- sys/dev/hyperv/vmbus/vmbus.c
+++ sys/dev/hyperv/vmbus/vmbus.c
@@ -137,6 +137,7 @@
static int vmbus_doattach(struct vmbus_softc *);
static void vmbus_event_proc_dummy(struct vmbus_softc *,
int);
+static bus_dma_tag_t vmbus_get_dma_tag(device_t parent, device_t child);
static struct vmbus_softc *vmbus_sc;
SYSCTL_NODE(_hw, OID_AUTO, vmbus, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
@@ -196,6 +197,7 @@
DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method),
DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method),
DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method),
+ DEVMETHOD(bus_get_dma_tag, vmbus_get_dma_tag),
DEVMETHOD_END
};
@@ -219,6 +221,16 @@
return vmbus_sc;
}
+static bus_dma_tag_t
+vmbus_get_dma_tag(device_t dev, device_t child)
+{
+#if defined(__aarch64__)
+ struct vmbus_softc *sc = vmbus_get_softc();
+ return (sc->dmat);
+#else
+ return(bus_get_dma_tag(dev));
+#endif
+}
void
vmbus_msghc_reset(struct vmbus_msghc *mh, size_t dsize)
{
@@ -1382,6 +1394,8 @@
struct sysctl_oid_list *child;
struct sysctl_ctx_list *ctx;
int ret;
+ device_t dev;
+ ACPI_HANDLE handle;
if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED)
return (0);
@@ -1420,6 +1434,27 @@
if (ret != 0)
goto cleanup;
+ /* Coherency attribute */
+ dev = devclass_get_device(devclass_find("vmbus_res"), 0);
+ handle = acpi_get_handle(dev);
+ if (ACPI_FAILURE(acpi_GetInteger(handle, "_CCA", &sc->coherent)))
+ sc->coherent = 0;
+
+ if (bootverbose)
+ device_printf(sc->vmbus_dev, "Bus is%s cache-coherent\n",
+ sc->coherent ? "" : " not");
+ bus_dma_tag_create(NULL, /* parent */
+ 1, 0, /* alignment, bounds */
+ BUS_SPACE_MAXADDR, /* lowaddr */
+ BUS_SPACE_MAXADDR, /* highaddr */
+ NULL, NULL, /* filter, filterarg */
+ BUS_SPACE_MAXSIZE, /* maxsize */
+ BUS_SPACE_UNRESTRICTED, /* nsegments */
+ BUS_SPACE_MAXSIZE, /* maxsegsize */
+ sc->coherent ? BUS_DMA_COHERENT : 0, /* flags */
+ NULL, NULL, /* lockfunc, lockarg */
+ &sc->dmat);
+
/*
* Setup interrupt.
*/
Index: sys/dev/hyperv/vmbus/vmbus_var.h
===================================================================
--- sys/dev/hyperv/vmbus/vmbus_var.h
+++ sys/dev/hyperv/vmbus/vmbus_var.h
@@ -129,6 +129,8 @@
void *icookie;
int vector;
#endif
+ bus_dma_tag_t dmat;
+ int coherent;
};
#define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 19, 12:08 AM (12 h, 59 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25566249
Default Alt Text
D41728.id126877.diff (2 KB)
Attached To
Mode
D41728: vmbus bus_get_dma_tag implementation for arm64
Attached
Detach File
Event Timeline
Log In to Comment