On Tue, Jul 22, 2003 at 05:38:15PM +0200, Marcel Holtmann wrote: > Hi Manuel, > > > > I installed linux-2.6.0-test1-ac2 and tried to port my driver for the > > > BlueFRITZ! USB Bluetooth dongle to 2.6. This device needs a firmware > > > download and I want to use the new firmware class for getting the > > > firmware file from userspace. After reading the documentation and > > > testing the driver samples I got the results that I expected. > > > > > > My problem is now that the firmware loader is not working with my > > > firmware file and it seems that this is a problem of the file size, > > > because copying small files through the same interface is working fine. > > > This is the file I want to load: > > > > > > -rw-r--r-- 1 holtmann staff 418352 Jul 11 12:38 bfubase.frm > > > > > > I have written my own firmware.agent hotplug script, which looks in > > > general something like this: > > > > > > echo 1 > $LOADING > > > cp bfubase.frm $DATA > > > echo 0 > $LOADING > > > > > > Loading the above firmware file through this interface results in > > > different behaviours. The results are complete freezes, instant reboots, > > > X server crashes with black screens and sometimes I see an oops about > > > virtual memory, but it goes bye bye too fast to let me do anything > > > useful with it. > > > > Could you send me a tarball with a sample showing the problem. If > > possible I would like to do "make test" and have it compile and crash > > the system appropriately :) > > I tracked down the problem to request_firmware() or a sysfs problem. > With the firmware included in a header file the driver itself works > perfect. You are right, the problem was in sysfs, attached goes a patch that WorksForMe (tm), please test and report. > Attached is a sample of how I use the request_firmware() and from the > documentation it seems correct to me. Not what I was asking for, but it seams OK. About the patch: - undo recent change, made in the believe that "buffer" was the size of the whole file, it is just PAGE_SIZE in size. - Since files are allowed to have unknown sizes, by setting their size to 0, we can't preallocate a buffer of their size on open. - don't use any offset when handling buffer - simplifies code - since it is temporary storage it doesn't really matter - undo relevant changes to request_firmware() code. - hopefully adapt drivers/pci/pci-sysfs.c to this changes - Please double check, I didn't look very carefully on this. Have a nice day Manuel -- --- Manuel Estrada Sainz ------------------------ ------------------- Let us have the serenity to accept the things we cannot change, courage to change the things we can, and wisdom to know the difference.