02 Nov, 2017

1 commit

  • Many source files in the tree are missing licensing information, which
    makes it harder for compliance tools to determine the correct license.

    By default all files without license information are under the default
    license of the kernel, which is GPL version 2.

    Update the files which contain no license information with the 'GPL-2.0'
    SPDX license identifier. The SPDX identifier is a legally binding
    shorthand, which can be used instead of the full boiler plate text.

    This patch is based on work done by Thomas Gleixner and Kate Stewart and
    Philippe Ombredanne.

    How this work was done:

    Patches were generated and checked against linux-4.14-rc6 for a subset of
    the use cases:
    - file had no licensing information it it.
    - file was a */uapi/* one with no licensing information in it,
    - file was a */uapi/* one with existing licensing information,

    Further patches will be generated in subsequent months to fix up cases
    where non-standard license headers were used, and references to license
    had to be inferred by heuristics based on keywords.

    The analysis to determine which SPDX License Identifier to be applied to
    a file was done in a spreadsheet of side by side results from of the
    output of two independent scanners (ScanCode & Windriver) producing SPDX
    tag:value files created by Philippe Ombredanne. Philippe prepared the
    base worksheet, and did an initial spot review of a few 1000 files.

    The 4.13 kernel was the starting point of the analysis with 60,537 files
    assessed. Kate Stewart did a file by file comparison of the scanner
    results in the spreadsheet to determine which SPDX license identifier(s)
    to be applied to the file. She confirmed any determination that was not
    immediately clear with lawyers working with the Linux Foundation.

    Criteria used to select files for SPDX license identifier tagging was:
    - Files considered eligible had to be source code files.
    - Make and config files were included as candidates if they contained >5
    lines of source
    - File already had some variant of a license header in it (even if
    Reviewed-by: Philippe Ombredanne
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

18 Jun, 2016

2 commits

  • The inline isa_register_driver stub simply allows compilation on systems
    with CONFIG_ISA disabled; the dummy isa_register_driver does not
    register an isa_driver at all. The inline isa_register_driver should
    return -ENODEV to indicate lack of support when attempting to register
    an isa_driver on such a system with CONFIG_ISA disabled.

    Cc: Matthew Wilcox
    Reported-by: Sasha Levin
    Tested-by: Ye Xiaolong
    Signed-off-by: William Breathitt Gray
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     
  • Several modern devices, such as PC/104 cards, are expected to run on
    modern systems via an ISA bus interface. Since ISA is a legacy interface
    for most modern architectures, ISA support should remain disabled in
    general. Support for ISA-style drivers should be enabled on a per driver
    basis.

    To allow ISA-style drivers on modern systems, this patch introduces the
    ISA_BUS_API and ISA_BUS Kconfig options. The ISA bus driver will now
    build conditionally on the ISA_BUS_API Kconfig option, which defaults to
    the legacy ISA Kconfig option. The ISA_BUS Kconfig option allows the
    ISA_BUS_API Kconfig option to be selected on architectures which do not
    enable ISA (e.g. X86_64).

    The ISA_BUS Kconfig option is currently only implemented for X86
    architectures. Other architectures may have their own ISA_BUS Kconfig
    options added as required.

    Reviewed-by: Guenter Roeck
    Signed-off-by: William Breathitt Gray
    Acked-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     

03 May, 2016

2 commits

  • max_num_isa_dev is a macro to determine the maximum possible number of
    ISA devices which may be registered in the I/O port address space given
    the address extent of the ISA devices.

    The highest base address possible for an ISA device is 0x3FF; this
    results in 1024 possible base addresses. Dividing the number of possible
    base addresses by the address extent taken by each device results in the
    maximum number of devices on a system.

    Signed-off-by: William Breathitt Gray
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     
  • The module_isa_driver macro is a helper macro for ISA drivers which do
    not do anything special in module init/exit. This eliminates a lot of
    boilerplate code. Each module may only use this macro once, and calling
    it replaces module_init and module_exit.

    Signed-off-by: William Breathitt Gray
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     

02 May, 2016

1 commit

  • The introduction of the ISA_BUS option blocks the compilation of ISA
    drivers on non-x86 platforms. The ISA_BUS configuration option should
    not be necessary if the X86_32 dependency can be decoupled from the ISA
    configuration option. This patch both removes the ISA_BUS configuration
    option entirely and removes the X86_32 dependency from the ISA
    configuration option.

    Acked-by: Ingo Molnar
    Signed-off-by: William Breathitt Gray
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     

30 Mar, 2016

1 commit

  • Many motherboards utilize a LPC to ISA bridge in order to decode
    ISA-style port-mapped I/O addresses. This is particularly true for
    embedded motherboards supporting the PC/104 bus (a bus specification
    derived from ISA).

    These motherboards are now commonly running 64-bit x86 processors. The
    X86_32 dependency should be removed from the ISA bus configuration
    option in order to support these newer motherboards.

    A new config option, CONFIG_ISA_BUS, is introduced to allow for the
    compilation of the ISA bus driver independent of the CONFIG_ISA option.
    Devices which communicate via ISA-compatible buses can now be supported
    independent of the dependencies of the CONFIG_ISA option.

    Signed-off-by: William Breathitt Gray
    Reviewed-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    William Breathitt Gray
     

17 Sep, 2007

1 commit


22 Jun, 2006

1 commit

  • During the recent "isa drivers using platform devices" discussion it was
    pointed out that (ALSA) ISA drivers ran into the problem of not having
    the option to fail driver load (device registration rather) upon not
    finding their hardware due to a probe() error not being passed up
    through the driver model. In the course of that, I suggested a seperate
    ISA bus might be best; Russell King agreed and suggested this bus could
    use the .match() method for the actual device discovery.

    The attached does this. For this old non (generically) discoverable ISA
    hardware only the driver itself can do discovery so as a difference with
    the platform_bus, this isa_bus also distributes match() up to the driver.

    As another difference: these devices only exist in the driver model due
    to the driver creating them because it might want to drive them, meaning
    that all device creation has been made internal as well.

    The usage model this provides is nice, and has been acked from the ALSA
    side by Takashi Iwai and Jaroslav Kysela. The ALSA driver module_init's
    now (for oldisa-only drivers) become:

    static int __init alsa_card_foo_init(void)
    {
    return isa_register_driver(&snd_foo_isa_driver, SNDRV_CARDS);
    }

    static void __exit alsa_card_foo_exit(void)
    {
    isa_unregister_driver(&snd_foo_isa_driver);
    }

    Quite like the other bus models therefore. This removes a lot of
    duplicated init code from the ALSA ISA drivers.

    The passed in isa_driver struct is the regular driver struct embedding a
    struct device_driver, the normal probe/remove/shutdown/suspend/resume
    callbacks, and as indicated that .match callback.

    The "SNDRV_CARDS" you see being passed in is a "unsigned int ndev"
    parameter, indicating how many devices to create and call our methods with.

    The platform_driver callbacks are called with a platform_device param;
    the isa_driver callbacks are being called with a "struct device *dev,
    unsigned int id" pair directly -- with the device creation completely
    internal to the bus it's much cleaner to not leak isa_dev's by passing
    them in at all. The id is the only thing we ever want other then the
    struct device * anyways, and it makes for nicer code in the callbacks as
    well.

    With this additional .match() callback ISA drivers have all options. If
    ALSA would want to keep the old non-load behaviour, it could stick all
    of the old .probe in .match, which would only keep them registered after
    everything was found to be present and accounted for. If it wanted the
    behaviour of always loading as it inadvertently did for a bit after the
    changeover to platform devices, it could just not provide a .match() and
    do everything in .probe() as before.

    If it, as Takashi Iwai already suggested earlier as a way of following
    the model from saner buses more closely, wants to load when a later bind
    could conceivably succeed, it could use .match() for the prerequisites
    (such as checking the user wants the card enabled and that port/irq/dma
    values have been passed in) and .probe() for everything else. This is
    the nicest model.

    To the code...

    This exports only two functions; isa_{,un}register_driver().

    isa_register_driver() register's the struct device_driver, and then
    loops over the passed in ndev creating devices and registering them.
    This causes the bus match method to be called for them, which is:

    int isa_bus_match(struct device *dev, struct device_driver *driver)
    {
    struct isa_driver *isa_driver = to_isa_driver(driver);

    if (dev->platform_data == isa_driver) {
    if (!isa_driver->match ||
    isa_driver->match(dev, to_isa_dev(dev)->id))
    return 1;
    dev->platform_data = NULL;
    }
    return 0;
    }

    The first thing this does is check if this device is in fact one of this
    driver's devices by seeing if the device's platform_data pointer is set
    to this driver. Platform devices compare strings, but we don't need to
    do that with everything being internal, so isa_register_driver() abuses
    dev->platform_data as a isa_driver pointer which we can then check here.
    I believe platform_data is available for this, but if rather not, moving
    the isa_driver pointer to the private struct isa_dev is ofcourse fine as
    well.

    Then, if the the driver did not provide a .match, it matches. If it did,
    the driver match() method is called to determine a match.

    If it did _not_ match, dev->platform_data is reset to indicate this to
    isa_register_driver which can then unregister the device again.

    If during all this, there's any error, or no devices matched at all
    everything is backed out again and the error, or -ENODEV, is returned.

    isa_unregister_driver() just unregisters the matched devices and the
    driver itself.

    More global points/questions...

    - I'm introducing include/linux/isa.h. It was available but is ofcourse
    a somewhat generic name. Moving more isa stuff over to it in time is
    ofcourse fine, so can I have it please? :)

    - I'm using device_initcall() and added the isa.o (dependent on
    CONFIG_ISA) after the base driver model things in the Makefile. Will
    this do, or I really need to stick it in drivers/base/init.c, inside
    #ifdef CONFIG_ISA? It's working fine.

    Lastly -- I also looked, a bit, into integrating with PnP. "Old ISA"
    could be another pnp_protocol, but this does not seem to be a good
    match, largely due to the same reason platform_devices weren't -- the
    devices do not have a life of their own outside the driver, meaning the
    pnp_protocol {get,set}_resources callbacks would need to callback into
    driver -- which again means you first need to _have_ that driver. Even
    if there's clean way around that, you only end up inventing fake but
    valid-form PnP IDs and generally catering to the PnP layer without any
    practical advantages over this very simple isa_bus. The thing I also
    suggested earlier about the user echoing values into /sys to set up the
    hardware from userspace first is... well, cute, but a horrible idea from
    a user standpoint.

    Comments ofcourse appreciated. Hope it's okay. As said, the usage model
    is nice at least.

    Signed-off-by: Rene Herman

    Rene Herman