Making the Linux Kernel better (without coding) Wolfram Sang - - PowerPoint PPT Presentation

making the linux kernel better
SMART_READER_LITE
LIVE PREVIEW

Making the Linux Kernel better (without coding) Wolfram Sang - - PowerPoint PPT Presentation

. . Making the Linux Kernel better (without coding) Wolfram Sang Consultant 1.2.2014, FOSDEM14 Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM14 1 / 20 About me Linux Kernel consultant & hacker


slide-1
SLIDE 1

. .

Making the Linux Kernel better

(without coding)

Wolfram Sang

Consultant

1.2.2014, FOSDEM’14

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 1 / 20

slide-2
SLIDE 2

About me

Linux Kernel consultant & hacker

(mostly embedded & driver frameworks)

I2C maintainer like to share knowledge and enable people to get active like muted devices, especially during talks

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 2 / 20

slide-3
SLIDE 3

How it all starts Unable to open device

Please make sure the camera is connected and that the correct driver is installed.

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 3 / 20

slide-4
SLIDE 4

Obtain the ID

lsusb lspci -nn .

Note

. . Existing entry does not mean existing driver and vice versa.

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 4 / 20

slide-5
SLIDE 5

Submit the ID

.

This is crowdsourcing!

. . http://www.linux-usb.org/usb-ids.html http://pciids.sourceforge.net/ Easily done, yet really useful for developers.

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 5 / 20

slide-6
SLIDE 6

Get more info, but check twice

(obviously) search for the ID/name check forums, bug trackers, HW databases… watch out, lots of outdated info out there

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 6 / 20

slide-7
SLIDE 7

Check the Windows-Drivers

.

INF-Files

. . Text files describing the driver to be installed. To obtain it, you might need: unzip unshield, cabextract WINE

Look here then: ~/.wine/drive_c/windows/inf ~/.wine/drive_c/windows/profiles/<user>/Temp

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 7 / 20

slide-8
SLIDE 8

Check the Windows-Drivers II

If the driver is generic, it will usually contain multiple IDs the driver will be responsible for name of the chipset used internally some other relevant info

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 8 / 20

slide-9
SLIDE 9

Example (another cam)

%USB\VID_0AC8&PID_0302.DeviceDesc%= …USB\VID_03F0&PID_1B07

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 9 / 20

slide-10
SLIDE 10

Example (this cam)

…USB\VID_0c45&PID_624c ; SN9C201 + MI1320 … …USB\VID_0458&PID_7045 ; SN9C201 + MI1320 for KYE Look 1320 V2 .

Find the corresponding driver

. . Use the Linux Kernel Driver Database. Search for the new ID together with the term lkddb.

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 10 / 20

slide-11
SLIDE 11

Tweak the driver

$ su # modprobe gspca_sn9c20x # cd /sys/bus/usb/drivers/gspca_sn9c20x/ # echo 0458 7045 > new_id1

1So useful, yet so unknown. Available for USB, PCI/Cardbus, and PCMCIA

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 11 / 20

slide-12
SLIDE 12

Showtime!

Let’s try that!

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 12 / 20

slide-13
SLIDE 13

Data is missing

generic drivers often need parameter

e.g. sensor type, bus addresses, various flags

wrong driver data did neither kill computer nor camera :) up to 3.13, driver specific data couldn’t be passed2 since 3.14, it is possible to pass a reference id

2for USB, that is

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 13 / 20

slide-14
SLIDE 14

Trying again

# echo 0458 7045 > remove_id # echo 0458 7045 0 0c45 624c > new_id

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 14 / 20

slide-15
SLIDE 15

Showtime again!

Let’s try that!

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 15 / 20

slide-16
SLIDE 16

Write a mail

Hello, I have $camera and could get it to run with Linux 3.14 by echoing its usb id ’0458 7045’ and the reference id ’0c45 624c’ to the new_id-file of $driver3. I am not familiar with creating patches, so I’d be happy if someone could pick this up. Regards,

3maybe copy the echo line from above

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 16 / 20

slide-17
SLIDE 17

Whom to send/CC it to?

check modinfo <module_name> check the head of the source file

LKDDB has a link if sources not present

scripts/get_maintainer.pl -f <src_file>

if kernel sources present

when in doubt: linux-kernel@vger.kernel.org (LKML) and me, of course: wsa@the-dreams.de

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 17 / 20

slide-18
SLIDE 18

The gain

cam works for you cam will work for all others you should get credit when support is added:

Reported-by: Your name <your_name@provider.org>

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 18 / 20

slide-19
SLIDE 19

If you are still interested…

.

Next step: Create a patch

. . Read: Documentation/development-process/* Read: Documentation/SubmittingPatches .

If you like hacking...

. . LED doesn’t seem to work maybe add V4L control for autoexposure

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 19 / 20

slide-20
SLIDE 20

The End

. . Thank you for your attention! .

Questions? Comments?

. . right now anytime at this conference wsa@the-dreams.de

Wolfram Sang (wsa@the-dreams.de) Making the Linux Kernel better 1.2.2014, FOSDEM’14 20 / 20