On Mon, Jul 10, 2017 at 11:07 AM, Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> wrote: > > Hi, > > Paul Zimmerman <pauldzim@xxxxxxxxx> writes: >>>>> > Did you try enabling verbose debugging in g_mass_storage? This >>>>> > requires setting CONFIG_USB_GADGET_DEBUG and CONFIG_USB_GADGET_VERBOSE >>>>> > in the kernel configuration and then rebuilding g_mass_storage.ko. >>>>> > And at runtime you may need to enable dynamic debugging by doing >>>>> > >>>>> > echo 'module g_mass_storage =p' >/sys/kernel/dynamic_debug/control >>>>> > >>>>> > before plugging the device into anything. Then compare the contents of >>>>> > the dmesg log for the different scenarios. In particular, look for >>>>> > differences between plugging it into System 2 (say) right after boot >>>>> > vs. after plugging it into System 1. >>>>> >>>>> OK interesting - I'll need to do some searching to understand how to >>>>> change that and rebuild g_mass_storage.ko but I like the idea of >>>>> seeing more detail about what is happening as the systems are closed >>>>> so I'm unable to do any troubleshooting at that end. >>>> >>>> Do you have any experience in building a kernel for the Raspberry Pi? >>>> The procedure is explained on several web sites, but you have to know >>>> what you're doing. >>> >>> No I don't - I'll have a read over things to see what I can suss out. >> >> The 'Linux File-Stor Gadget' string is part of the SCSI inquiry data, and >> is set by the fsg_common_set_inquiry_string() function in f_mass_storage.c. >> This must be what the problematic host systems are reacting to, and not any >> of the USB info that you have overridden. It looks like there is a way to >> override this string using configfs, perhaps Alan will know how to do this. > > There should be a file named "inquiry_string" on mass storage's function > directory: > > # find /c/usb_gadget/storage/functions/mass_storage.1/ > /c/usb_gadget/storage/functions/mass_storage.1/ > /c/usb_gadget/storage/functions/mass_storage.1/lun.0 > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/inquiry_string > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/nofua > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/cdrom > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/removable > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/ro > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/file > /c/usb_gadget/storage/functions/mass_storage.1/stall > > Just write your string to it: > > # echo "My Inquiry String" > /c/usb_gadget/storage/functions/mass_storage.1/lun.0/inquiry_string Thanks Felipe & Paul - that's useful to know and I'll have a wee play about with it to see if I can get it showing more consistently. However now I can get it working reliably with plugging it into another system first I suspect that this isn't quite the problem - I'm about to reply to Alan's message shortly with dmesg logs to see if that helps clarify things at all! Cheers Alan -- 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