On Mon, 19 Aug 2019, Roger Quadros wrote: > On 15/08/2019 17:39, Alan Stern wrote: > > On Thu, 15 Aug 2019, Roger Quadros wrote: > > > >> Felipe & Alan, > >> > >> On 21/07/2019 21:32, Pawel Laszczak wrote: > >>> This patch introduce new Cadence USBSS DRD driver to linux kernel. > >>> > >>> The Cadence USBSS DRD Controller is a highly configurable IP Core which > >>> can be instantiated as Dual-Role Device (DRD), Peripheral Only and > >>> Host Only (XHCI)configurations. > >>> > >>> The current driver has been validated with FPGA burned. We have support > >>> for PCIe bus, which is used on FPGA prototyping. > >>> > >>> The host side of USBSS-DRD controller is compliance with XHCI > >>> specification, so it works with standard XHCI Linux driver. > >> > >> While testing this driver I encountered the following issue if I do the following. > >> > >> 1) USB port is "otg" and nothing connected so it is in IDLE mode to begin with. > >> i.e. HCD & UDC not registered. > >> > >> 2) Load mass storage gadget with backing medium. > >> > modprobe g_mass_storage file=lun stall=0 > >> > >> [ 28.172142] udc-core: couldn't find an available UDC - added [g_mass_storage] to list of pending drivers > >> > >> 3) Connect port to PC host ... > >> [ 30.786313] Mass Storage Function, version: 2009/09/11 > >> [ 30.791455] LUN: removable file: (no medium) > >> [ 31.039497] lun0: unable to open backing file: 500M.bin > >> Is opening the backing file from irq_thread_fn the issue here? > >> If yes, how to resolve this? > > > > I would guess that it probably is related to that. > > > > In any case, the backing filename should be an explicit complete path. > > Who knows what the current directory will be when the actual open call > > takes place? > > This seems to be the case. It works fine with complete path. > > Do we need to care about this in the mass storage gadget or just > rely on the user to provide the full path? I think it's okay to rely on the user to provide the full path. Alan Stern