On Wed, 30 Mar 2011 10:42:46 -0400 (EDT) Alan Stern wrote: > On Tue, 29 Mar 2011, Randy Dunlap wrote: > > > In 2.6.39-rc1 on x86_64, I get 92 total section mismatch warnings. > > usb/gadget accounts for 75 of those. > > > > Does usb/gadget code have any special considerations for hotplug-ability > > that is different from the rest of the kernel source tree? > > As far as I know, there are no special requirements. The mismatches > probably arose for historical reasons. People working on gagdget > drivers tend to be oriented toward embedded systems, where minimizing > memory consumption is a prime concern. Therefore they try hard to make > sure that code and data can be unloaded when no longer needed. But > when the first gadget drivers were being written, the rules for doing > this correctly weren't clearly understood and mistakes were made. > Later drivers copied those mistakes, and nobody cared about the > mismatch warnings badly enough to fix them. > > In theory, fixing them should be a straightforward, almost mechanical > job. Provided one can track down the exact causes, of course. There > used to be a Kbuild option for diagnosing section mismatches, but I > can't find it now -- and I don't remember how much detail it provided. Actually I only see one thing to be fixed -- if it's acceptable. Please see the patch below. --- From: Randy Dunlap <randy.dunlap@xxxxxxxxxx> Fix 41 occurrences of this type of Section mismatch warning in g_mass_storage, g_serial, g_cdc, g_multi, g_nokia, g_ether, g_ffs: (the 75 number reported earlier contained some duplicates.) WARNING: drivers/usb/gadget/g_mass_storage.o(.text+0x687a): Section mismatch in reference from the function fsg_bind() to the function .devinit.text:usb_ep_autoconfig() The function fsg_bind() references the function __devinit usb_ep_autoconfig(). This is often because fsg_bind lacks a __devinit annotation or the annotation of usb_ep_autoconfig is wrong. Signed-off-by: Randy Dunlap <randy.dunlap@xxxxxxxxxx> Cc: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> --- include/linux/usb/gadget.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- lnx-2639-rc1.orig/include/linux/usb/gadget.h +++ lnx-2639-rc1/include/linux/usb/gadget.h @@ -890,7 +890,7 @@ static inline void usb_free_descriptors( /* utility wrapping a simple endpoint selection policy */ extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, - struct usb_endpoint_descriptor *) __devinit; + struct usb_endpoint_descriptor *); extern void usb_ep_autoconfig_reset(struct usb_gadget *) __devinit; -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html