lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 13 Aug 2011 22:44:42 +0200
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	linux-kernel@...r.kernel.org
Cc:	"Linux/m68k" <linux-m68k@...r.kernel.org>
Subject: Driver framework: binding a driver to two devices?

As Amiga Zorro expansion boards have only one BAR (unlike PCI, which has
multiple BARs), several Amiga graphics cards show up as two Zorro devices:
one for the graphics memory and one for the graphics controller's registers.

Traditionally, a driver for such a device used

    dev1 = zorro_find_device(id1, ...)
    dev2 = zorro_find_device(id2, ...)

to find the two devices and match them.

With the "new" driver framework, the matching with device id1 is now
done using a
struct zorro_driver with a table of IDs, while the matching with device id2 is
still done by calling zorro_find_device(id2, ...).

Recently (with cirrusfb) it turned out that the call to
zorro_find_device(id2, ...)
may fail to find the second device. I suspect this happens due to the second
device haven't been probed for at the time the zorro_driver for the
first device is
initialized.

I expect this can be fixed by delaying all calls to device_register() in
amiga_zorro_probe() until all devices have been detected and added to the array
used by zorro_find_device(). But I was wondering whether there's a more generic
way in the driver framework to bind a driver to two devices?

Are there any PCI devices that show similar behavior?
I know some PCI drivers look up data in DMI tables, but that's not
really the same.

Thanks in advance!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ