Skip to contentSkip to conversation

PATCHES: usb with CONFIG_SLAB_DEBUG (using new pci_pool API)

PATCH David Brownell 1 participant 1 message Mar 23, 2001

lore
Share & tools
lore
#0 lore raw

Hi,

Here are updated patches getting usb-ohci and usb-uhci to behave on an ac20 kernel with slab debugging enabled. It uses the pci_pool API, discussed earlier.

- pcipool-0323.patch ... adds pci_pool apis to <linux/pci.h>; bugfixes vs what I sent to linux-usb-devel yesterday

- ohci-0323.patch ... basically what I sent yesterday

- uhci-0323.patch ... bugfixes vs what I sent yesterday; adds a fix for an unrelated oops (referencing an urb after the completion function freed it)

I don't know about any problems with these, but that doesn't mean they're not lurking. Converting usb-ohci to use the rest of the pci dma mapping APIs is being done separately, and I think Johannes has an update pending to "uhci.c". The EHCI host controller driver (latest) is also using "pci_pool".

Does anyone want particularly want to see further discussion about the pci_pool API? This version dropped the explicit address mapping primitive that was contentious last time, and nothing else appeared to be troublesome. (Shouldn't be!) This version does add another pci_pool_create() parameter, as needed to handle a 4KB-crossing restriction for ehci. That verges on too many arguments, any more and I'd want them wrapped into a (readonly) structure.

- Dave

linux/pci.h renamed from linux/pci-orig.h +8 -0
@@ -553,6 +553,14 @@
 struct pci_driver *pci_dev_driver(const struct pci_dev *);
 const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev);
 
+/* kmem_cache style wrapper around pci_alloc_consistent() */
+struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
+		size_t size, size_t align, size_t allocation, int flags);
+void pci_pool_destroy (struct pci_pool *pool);
+
+void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
+void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
+
 #endif /* CONFIG_PCI */
 
 /* Include architecture-dependent settings and functions */
pci/pci.c renamed from pci/pci-orig.c +345 -0

355 lines not on this page · raw message

usb/usb-ohci.h renamed from usb/usb-ohci-orig.h +76 -74

246 lines not on this page · raw message

usb/usb-ohci.c renamed from usb/usb-ohci-orig.c +40 -36

239 lines not on this page · raw message

usb/usb-uhci.h renamed from usb/usb-uhci-orig.h +3 -0
@@ -212,7 +212,10 @@
 	struct list_head urb_unlinked;	// list of all unlinked  urbs
 	long timeout_check;
 	int timeout_urbs;
+#ifdef	CONFIG_PCI
 	struct pci_dev *uhci_pci;
+	struct pci_pool *desc_pool;
+#endif
 } uhci_t, *puhci_t;
 
 
usb/usb-uhci.c renamed from usb/usb-uhci-orig.c +105 -100

504 lines not on this page · raw message

usb/usb-uhci-debug.h renamed from usb/usb-uhci-debug-orig.h +1 -1
@@ -23,7 +23,7 @@
 }
 #endif
 
-static void uhci_show_td (puhci_desc_t td)
+static void __attribute__((__unused__)) uhci_show_td (puhci_desc_t td)
 {
 	char *spid;