Updating Linux Device Driver - linux-device-driver

I'm a LDD newbie and I've been assigned a task of upgrading a driver which worked on a 2.6.35 kernel to work on a current kernel, 3.6.10.
In order to get the driver to compile, I had to change from ioctl to unlocked_ioctl as described here.
Yet, the driver fails to execute several of its operations properly.
The driver is supposed to use DMA via the PCI bus to write to a buffer on the host. I suspect the interrupts the device is issuing are not going through.
Are there any obvious changes that I need to make to get this driver to work?

I assume there is change only in the kernel version and not there in your hardware. Do you get any error while compiling?

Related

Where Can i find an emulator to test my operating system for ARMv8?

I am currently writing an OS based on ARMv8 processor. I want to find an emulator that acts like the processor so I can see my OS working or not and to check my work.
I am on windows 10. are there any emulators recommended ?
I searched SO but no answer. thanks.
Looks like QEMU version 2.1+ is what you want
the latest version of upstream QEMU (2.1) now includes full ARMv8 system emulation support. This means that users can use upstream QEMU to run a full 64-bit ARMv8-A kernel and filesystem, such as a 64-bit Ubuntu cloud image. This was no small endeavour as it involved emulating a completely new instruction set, exception model, CPU implementation, and more. The implementation was verified with a custom instruction verification tool (RISU) and was heavily reviewed upstream by an engaged and incredibly supportive upstream QEMU community.
source

Load device drivers into kernel

In Linux Operating System, device drivers are also loaded into kernel along with operating system. Sometime these drivers get crashed due to some circumstances and operating system become not responding or restarts. To avoid these situations, first approach is to load these drivers into the core kernel. Secondly, these drivers can be loaded into kernel as a separate process.
To avoid such problem which method should be used and why?
1st or 2nd?
In Linux kernel there is no such thing like "separate process" for the driver. Drivers operate in the same address space as the kernel core and share threads with the kernel core.
Situation when crash in a device driver may crash entire OS is unavoidable in the vanilla Linux kernel.

Cannot update FEZ Hydra firmware: Device is not connected or not responding

Update 1:
Hi friends, could you please recommend me a powered USB hub in Australia(preferred in Melbourne)? I guess my problem is caused by the insufficient power supply.
Hi friends,
I have a FEZ Hydra Basic kit. I got it in 2012 (might be in Sep).
Today I downloaded the latest SDKs, drivers and everything(NETMF and Gadgeteer Package 2014 R1). (.NET Micro Framework 4.3 and the firmware I have on my laptop is 4.2.6.2)
But the firmware on my deivce is 4.1.x.x(I was lucky to saw the device's firmware version just once and I followed the instruction on the software FEZ Config, but failed with errors).
After that, I cannot get the Device's firmware version any more.
I found changing USB ports sometimes help. I have 4 USB ports, some of them can connected to the device, others are not.
So I have no idea to update the firmware in other way.
Could someone please help me to figure out how to find a way to update my firmware?
In the attached image, it shows: the FEZ Config detected the FEZ Hydra and was trying to get the device's firmware version, but it failed to do so and followed by an error message say: Failure - Device is not connected or not responding.
As I mentioned above, I was lucky to see the FEZ Config successfully got the device's version only once.
So my guess is - is it because the output power is not strong enough to support the operation, so I have to use something like a USB hub which has a strong and stable power?(I saw someone mentioned this and cannot find the comments any more).
Bt the way, all USB ports I mentioned above are directly on my laptop which means they get power directly from motherboard, so they should have strong and stable power to support my operations.
I have been stuck at this issue for the whole day, I really hope some friends can help me out.
Thank you very much in advance.
I've had like the same issue. While updating the firmware it threw me that message and I could not reach my Gadgeteer *Fez Hydra at all. I managed to solve it by attaching an external power supply to it. I use the USB Client DP (Dual Power) 1.3. This way you do need the power over USB part and you can safely update the firmware.
USB Client: https://www.ghielectronics.com/catalog/product/280
edit: If that doesn't solve your isse you might want to reset the Loader first. Which is given as a tip on the GHI website before updating the firmware.

clGetPlatformIDs error -1001 when called in PostgreSQL UDF

I'm trying to write an OpenCL function that would be executed inside PostgreSQL. To do this i create DLL from my OpenCL code and link it to postgres using User-Defined Function mechanism. Everything goes well until clGetPlatformIDs is called. Function returns error -1001, which I read that indicates problem with finding OpenCL drivers.
I've tried to compile the same code(i had to remove some postgres magic) to exe and runed it with success - all platforms were found correctly, so I assume that i have correctly set up SDK and drivers.
I am runing PostgreSQL 9.1 on windows 7 x64. I am also using Nvidia CUDA SDK 4.2 with Visual Studio 2010 and running my code on GeForce GTS 450.
It's MSFT's problem with Windows, Services, GPUs, Security and device drivers.
You can't run PostgreSQL as a service on Windows AND see any GPUs. You are hitting Session O Isolation which does NOT allow any 'graphics' device access from a Windows Service. You can start PostgreSQL as a process (not a service) or put the server on Linux.
See http://www.scribd.com/doc/58343489/Windows-Session-0-Isolation-Impact-on-GPU-as-Service
Also there are other important reasons to run on Linux, as Windows will want to reboot your GPU if the screen is not accessed before the timeout period. See
http://msdn.microsoft.com/en-us/library/windows/hardware/ff570088%28v=vs.85%29.aspx
NVida have a non-graphics GPU device driver for specific Tesla cards on Windows. These cards don't have any video output. So they aren't considered to be graphics device drivers.
Maybe the libraries try to locate the SDK using some environment-variables and the environment is not inherited inside the PostegreSQL context.
So try to dump the environment from your two codes and check if any OpenCL/Cuda variables is available in your standalone program and missing in your PostegreSQL UDF.

omap3 gpmc config in linux

Is it possible to change configuration of a OMAP3 gpmc after boot-up on linux? I am writing a driver for a device that use the OMAP3 gpmc bus. We would prefer to be able to load the driver only when needed. Would linux allow it, since the GPMC control also program memory?
(If you haven't done it already, I suggest you join TI e2e community: there are many ongoing discussions about TI OMAP architecture and TI engineers overview the forums to provide answers).
You could specify a device driver as built-in or module when you configure the kernel. You can load that module later on with the insmod command. That option depends on your target architecture, of course.