1. 19 2月, 2014 2 次提交
    • A
      x86: align x86 arch with generic CPU modalias handling · 2b9c1f03
      Ard Biesheuvel 提交于
      The x86 CPU feature modalias handling existed before it was reimplemented
      generically. This patch aligns the x86 handling so that it
      (a) reuses some more code that is now generic;
      (b) uses the generic format for the modalias module metadata entry, i.e., it
          now uses 'cpu:type:x86,venVVVVfamFFFFmodMMMM:feature:,XXXX,YYYY' instead of
          the 'x86cpu:vendor:VVVV:family:FFFF:model:MMMM:feature:,XXXX,YYYY' that was
          used before.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2b9c1f03
    • A
      cpu: add generic support for CPU feature based module autoloading · 67bad2fd
      Ard Biesheuvel 提交于
      This patch adds support for advertising optional CPU features over udev
      using the modalias, and for declaring compatibility with/dependency upon
      such a feature in a module.
      
      The mapping between feature numbers and actual features should be provided
      by the architecture in a file called <asm/cpufeature.h> which exports the
      following functions/macros:
      - cpu_feature(FEAT), a preprocessor macro that maps token FEAT to a
        numeric index;
      - bool cpu_have_feature(n), returning whether this CPU has support for
        feature #n;
      - MAX_CPU_FEATURES, an upper bound for 'n' in the previous function.
      
      The feature can then be enabled by setting CONFIG_GENERIC_CPU_AUTOPROBE
      for the architecture.
      
      For instance, a module that registers its module init function using
      
        module_cpu_feature_match(FEAT_X, module_init_function)
      
      will be probed automatically when the CPU's support for the 'FEAT_X'
      feature is advertised over udev, and will only allow the module to be
      loaded by hand if the 'FEAT_X' feature is supported.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67bad2fd
  2. 08 2月, 2014 1 次提交
    • J
      Modpost: fixed USB alias generation for ranges including 0x9 and 0xA · 03b56329
      Jan Moskyto Matejka 提交于
      Commit afe2dab4 ("USB: add hex/bcd detection to usb modalias generation")
      changed the routine that generates alias ranges. Before that change, only
      digits 0-9 were supported; the commit tried to fix the case when the range
      includes higher values than 0x9.
      
      Unfortunately, the commit didn't fix the case when the range includes both
      0x9 and 0xA, meaning that the final range must look like [x-9A-y] where
      x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced.
      
      Modprobe doesn't complain as it sees no difference between no-match and
      bad-pattern results of fnmatch().
      
      Fixing this simple bug to fix the aliases.
      Also changing the hardcoded beginning of the range to uppercase as all the
      other letters are also uppercase in the device version numbers.
      
      Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK.
      Signed-off-by: NJan Moskyto Matejka <mq@suse.cz>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      03b56329
  3. 04 7月, 2013 1 次提交
    • A
      rapidio: add udev notification · 3bdbb62f
      Alexandre Bounine 提交于
      Add RapidIO-specific modalias generation to enable udev notifications
      about RapidIO-specific events.
      
      The RapidIO modalias string format is shown below:
      
      "rapidio:vNNNNdNNNNavNNNNadNNNN"
      
      Where:
      v  - Device Vendor ID (16 bit),
      d  - Device ID (16 bit),
      av - Assembly Vendor ID (16 bit),
      ad - Assembly ID (16 bit),
      
      as they are reported in corresponding Capability Registers (CARs)
      of each RapidIO device.
      Signed-off-by: NAlexandre Bounine <alexandre.bounine@idt.com>
      Cc: Matt Porter <mporter@kernel.crashing.org>
      Cc: Li Yang <leoli@freescale.com>
      Cc: Kumar Gala <galak@kernel.crashing.org>
      Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
      Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
      Cc: Stef van Os <stef.van.os@Prodrive.nl>
      Cc: Jean Delvare <jdelvare@suse.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3bdbb62f
  4. 03 7月, 2013 1 次提交
    • D
      Fix a build warning in scripts/mod/file2alias.c · 04130cc9
      Daniel Tang 提交于
      On some systems, __used is already defined in sys/cdefs.h and causes
      a build warning:
      
      scripts/mod/file2alias.c:85:1: warning: "__used" redefined
      In file included from /usr/include/stdio.h:64,
                       from scripts/mod/modpost.h:1,
      		                  from scripts/mod/file2alias.c:13:
      				  /usr/include/sys/cdefs.h:146:1: warning: this is the location of the previous definition
      
      This adds an extra check before defining the __used macro to see if
      the macro was already defined elsewhere.
      Signed-off-by: NDaniel Tang <dt.tangr@gmail.com>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      04130cc9
  5. 29 3月, 2013 1 次提交
  6. 25 1月, 2013 1 次提交
  7. 07 9月, 2012 1 次提交
  8. 05 9月, 2012 1 次提交
  9. 14 6月, 2012 1 次提交
    • B
      USB: allow match on bInterfaceNumber · 81df2d59
      Bjørn Mork 提交于
      Some composite USB devices provide multiple interfaces
      with different functions, all using "vendor-specific"
      for class/subclass/protocol.  Another OS use interface
      numbers to match the driver and interface. It seems
      these devices are designed with that in mind - using
      static interface numbers for the different functions.
      
      This adds support for matching against the
      bInterfaceNumber, allowing such devices to be supported
      without having to resort to testing against interface
      number whitelists and/or blacklists in the probe.
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      81df2d59
  10. 01 5月, 2012 2 次提交
  11. 19 4月, 2012 1 次提交
    • D
      Fix modpost failures in fedora 17 · e88aa7bb
      David Miller 提交于
      The symbol table on x86-64 starts to have entries that have names
      like:
      
      _GLOBAL__sub_I_65535_0___mod_x86cpu_device_table
      
      They are of type STT_FUNCTION and this one had a length of 18.  This
      matched the device ID validation logic and it barfed because the
      length did not meet the device type's criteria.
      
      --------------------
      FATAL: arch/x86/crypto/aesni-intel: sizeof(struct x86cpu_device_id)=16 is not a modulo of the size of section __mod_x86cpu_device_table=18.
      Fix definition of struct x86cpu_device_id in mod_devicetable.h
      --------------------
      
      These are some kind of compiler tool internal stuff being emitted and
      not something we want to inspect in modpost's device ID table
      validation code.
      
      So skip the symbol if it is not of type STT_OBJECT.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NMichal Marek <mmarek@suse.cz>
      e88aa7bb
  12. 16 4月, 2012 1 次提交
  13. 27 2月, 2012 1 次提交
  14. 14 2月, 2012 2 次提交
  15. 27 1月, 2012 1 次提交
    • A
      Add driver auto probing for x86 features v4 · 644e9cbb
      Andi Kleen 提交于
      There's a growing number of drivers that support a specific x86 feature
      or CPU.  Currently loading these drivers currently on a generic
      distribution requires various driver specific hacks and it often
      doesn't work.
      
      This patch adds auto probing for drivers based on the x86 cpuid
      information, in particular based on vendor/family/model number
      and also based on CPUID feature bits.
      
      For example a common issue is not loading the SSE 4.2 accelerated
      CRC module: this can significantly lower the performance of BTRFS
      which relies on fast CRC.
      
      Another issue is loading the right CPUFREQ driver for the current CPU.
      Currently distributions often try all all possible driver until
      one sticks, which is not really a good way to do this.
      
      It works with existing udev without any changes. The code
      exports the x86 information as a generic string in sysfs
      that can be matched by udev's pattern matching.
      
      This scheme does not support numeric ranges, so if you want to
      handle e.g. ranges of model numbers they have to be encoded
      in ASCII or simply all models or families listed. Fixing
      that would require changing udev.
      
      Another issue is that udev will happily load all drivers that match,
      there is currently no nice way to stop a specific driver from
      being loaded if it's not needed (e.g. if you don't need fast CRC)
      But there are not that many cpu specific drivers around and they're
      all not that bloated, so this isn't a particularly serious issue.
      
      Originally this patch added the modalias to the normal cpu
      sysdevs. However sysdevs don't have all the infrastructure
      needed for udev, so it couldn't really autoload drivers.
      This patch instead adds the CPU modaliases to the cpuid devices,
      which are real devices with full support for udev. This implies
      that the cpuid driver has to be loaded to use this.
      
      This patch just adds infrastructure, some driver conversions
      in followups.
      
      Thanks to Kay for helping with some sysfs magic.
      
      v2: Constifcation, some updates
      v4: (trenn@suse.de):
          - Use kzalloc instead of kmalloc to terminate modalias buffer
          - Use uppercase hex values to match correctly against hex values containing
            letters
      
      Cc: Dave Jones <davej@redhat.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Jen Axboe <axboe@kernel.dk>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Huang Ying <ying.huang@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      644e9cbb
  16. 21 1月, 2012 1 次提交
    • R
      Revert "ARM: sa11x0: Implement autoloading of codec and codec pdata for mcp bus." · 65f2e753
      Russell King 提交于
      This reverts commit 5dd7bf59.
      
      Conflicts:
      
      	scripts/mod/file2alias.c
      
      This change is wrong on many levels.  First and foremost, it causes a
      regression.  On boot on Assabet, which this patch gives a codec id of
      'ucb1x00', it gives:
      
      	ucb1x00 ID not found: 1005
      
      0x1005 is a valid ID for the UCB1300 device.
      
      Secondly, this patch is way over the top in terms of complexity.  The
      only device which has been seen to be connected with this MCP code is
      the UCB1x00 (UCB1200, UCB1300 etc) devices, and they all use the same
      driver.  Adding a match table, requiring the codec string to match the
      hardware ID read out of the ID register, etc is completely over the top
      when we can just read the hardware ID register.
      65f2e753
  17. 13 1月, 2012 2 次提交
  18. 09 1月, 2012 1 次提交
  19. 22 11月, 2011 1 次提交
    • D
      ARM: amba: Auto-generate AMBA driver module aliases during modpost · 523817bd
      Dave Martin 提交于
      This patch adds the necessary support in file2alias.c to define
      suitable aliases based on the amba_id table in AMBA driver modules.
      
      This should be sufficient to allow such modules to be auto-loaded
      via udev.  The AMBA bus driver's uevent hotplug code is also
      modified to pass an approriate MODALIAS string in the event.
      
      For simplicity, the AMBA ID is treated an an opaque 32-bit numeber.
      Module alises use patterns as appropriate to describe the value-
      mask pairs described in the driver's amba_id list.
      
      The proposed alias format is (extended regex):
      
          ^amba:d(HEX){8}$
      
      Where HEX is a single upper-case HEX digit or a pattern (? or []
      expression) matching a single upper-case HEX digit, as expected by
      udev.
      
      "d" is short for "device", following existing alias naming
      conventions for other device types.  This adds some flexibility for
      unambiguously extending the alias format in the future by adding
      additional leading and trailing fields, if this turns out to be
      necessary.
      Signed-off-by: NDave Martin <dave.martin@linaro.org>
      Acked-by: NPawel Moll <pawel.moll@arm.com>
      523817bd
  20. 26 8月, 2011 2 次提交
  21. 11 5月, 2011 1 次提交
    • R
      bcma: add Broadcom specific AMBA bus driver · 8369ae33
      Rafał Miłecki 提交于
      Broadcom has released cards based on a new AMBA-based bus type. From a
      programming point of view, this new bus type differs from AMBA and does
      not use AMBA common registers. It also differs enough from SSB. We
      decided that a new bus driver is needed to keep the code clean.
      
      In its current form, the driver detects devices present on the bus and
      registers them in the system. It allows registering BCMA drivers for
      specified bus devices and provides them basic operations. The bus driver
      itself includes two important bus managing drivers: ChipCommon core
      driver and PCI(c) core driver. They are early used to allow correct
      initialization.
      
      Currently code is limited to supporting buses on PCI(e) devices, however
      the driver is designed to be used also on other hosts. The host
      abstraction layer is implemented and already used for PCI(e).
      
      Support for PCI(e) hosts is working and seems to be stable (access to
      80211 core was tested successfully on a few devices). We can still
      optimize it by using some fixed windows, but this can be done later
      without affecting any external code. Windows are just ranges in MMIO
      used for accessing cores on the bus.
      
      Cc: Greg KH <greg@kroah.com>
      Cc: Michael Büsch <mb@bu3sch.de>
      Cc: Larry Finger <Larry.Finger@lwfinger.net>
      Cc: George Kashperko <george@znau.edu.ua>
      Cc: Arend van Spriel <arend@broadcom.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andy Botting <andy@andybotting.com>
      Cc: linuxdriverproject <devel@linuxdriverproject.org>
      Cc: linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      8369ae33
  22. 03 8月, 2010 1 次提交
  23. 19 5月, 2010 1 次提交
    • O
      MODULE_DEVICE_TABLE(isapnp, ...) does nothing · fedb3d27
      Ondrej Zary 提交于
      On Monday 23 November 2009 04:29:53 Rusty Russell wrote:
      > On Mon, 23 Nov 2009 07:31:57 am Ondrej Zary wrote:
      > > The problem is that
      > > scripts/mod/file2alias.c simply ignores isapnp.
      >
      > AFAICT it always has, and noone has complained until now.  Perhaps
      > something was still reading /lib/modules/`uname -r`/modules.isapnpmap?
      
      The patch below works fine (at least with Debian). It needs your first
      patch that moves the definitions to mod_devicetable.h. Verified that
      aliases for these modules are generated correctly:
      
      drivers/media/radio/radio-sf16fmi.c
      drivers/net/ne.c
      drivers/net/3c515.c
      drivers/net/smc-ultra.c
      drivers/pcmcia/i82365.c
      drivers/scsi/aha1542.c
      drivers/scsi/aha152x.c
      drivers/scsi/sym53c416.c
      drivers/scsi/g_NCR5380.c
      
      Tested with RTL8019AS (ne), AVA-1505AE (aha152x) and dtc436e (g_NCR5380)
      cards - they now work automatically.
      
      Generate pnp:d aliases for isapnp_device_tables. This allows udev to load
      these modules automatically.
      Signed-off-by: NOndrej Zary <linux@rainbow-software.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      fedb3d27
  24. 18 5月, 2010 1 次提交
  25. 03 4月, 2010 1 次提交
  26. 18 1月, 2010 1 次提交
    • M
      modpost: fix segfault in sym_is() with prefixed arches · 3a5dd791
      Mike Frysinger 提交于
      The sym_is() compares a symbol in an attempt to automatically skip symbol
      prefixes.  It does this first by searching the real symbol with the normal
      unprefixed symbol.  But then it uses the length of the original symbol to
      check the end of the substring instead of the length of the symbol it is
      looking for.  On non-prefixed arches, this is effectively the same thing,
      so there is no problem.  On prefixed-arches, since this is exceeds by just
      one byte, a crash is rare and it is usually a NUL byte anyways.  But every
      once in a blue moon, you get the right page alignment and it segfaults.
      
      For example, on the Blackfin arch, sym_is() will be called with the real
      symbol "___mod_usb_device_table" as "symbol" when looking for the normal
      symbol "__mod_usb_device_table" as "name".  The substring will thus return
      one byte into "symbol" and store it into "match".  But then "match" will
      be indexed with the length of "symbol" instead of "name" and so we will
      exceed the storage.  i.e. the code ends up doing:
      	char foo[] = "abc"; return foo[strlen(foo)+1] == '\0';
      Signed-off-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3a5dd791
  27. 12 12月, 2009 2 次提交
    • N
      USB: handle bcd incrementation in usb modalias generation · 55f49f26
      Nathaniel McCallum 提交于
      This patch fixes a bug when incrementing/decrementing on a BCD formatted
      integer (i.e. 0x09++ should be 0x10 not 0x0A).  It just adds a function
      for incrementing/decrementing BCD integers by converting to decimal,
      doing the increment/decrement and then converting back to BCD.
      Signed-off-by: NNathaniel McCallum <nathaniel@natemccallum.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      55f49f26
    • N
      USB: add hex/bcd detection to usb modalias generation · afe2dab4
      Nathaniel McCallum 提交于
      The current code to generate usb modaliases from usb_device_id assumes
      that the device's bcdDevice descriptor will actually be in BCD format.
      While this should be a sane assumption, some devices don't follow spec
      and just use plain old hex.  This causes drivers for these devices to
      generate invalid modalias lines which will never actually match for the
      hardware.
      
      The following patch adds hex support for bcdDevice in file2alias.c by
      detecting when a driver uses a hex formatted bcdDevice_(lo|hi) and
      adjusts the output to hex format accordingly.
      
      Drivers for devices which have bcdDevice conforming to BCD will have no
      change in modalias output.  Drivers for devices which don't conform
      (i.e. ibmcam) should now generate valid modaliases.
      
      EXAMPLE OUTPUT (ibmcam; space added to highlight change)
          Old: usb:v0545p800D d030[10-9] dc*dsc*dp*ic*isc*ip*
          New: usb:v0545p800D d030a      dc*dsc*dp*ic*isc*ip*
      Signed-off-by: NNathaniel McCallum <nathaniel@natemccallum.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      afe2dab4
  28. 23 9月, 2009 2 次提交
    • A
      spi: prefix modalias with "spi:" · e0626e38
      Anton Vorontsov 提交于
      This makes it consistent with other buses (platform, i2c, vio, ...).  I'm
      not sure why we use the prefixes, but there must be a reason.
      
      This was easy enough to do it, and I did it.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Dmitry Torokhov <dtor@mail.ru>
      Cc: Samuel Ortiz <sameo@openedhand.com>
      Cc: "John W. Linville" <linville@tuxdriver.com>
      Acked-by: NMike Frysinger <vapier.adi@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e0626e38
    • A
      spi: add support for device table matching · 75368bf6
      Anton Vorontsov 提交于
      With this patch spi drivers can use standard spi_driver.id_table and
      MODULE_DEVICE_TABLE() mechanisms to bind against the devices.  Just like
      we do with I2C drivers.
      
      This is useful when a single driver supports several variants of devices
      but it is not possible to detect them in run-time (like non-JEDEC chips
      probing in drivers/mtd/devices/m25p80.c), and when platform_data usage is
      overkill.
      
      This patch also makes life a lot easier on OpenFirmware platforms, since
      with OF we extensively use proper device IDs in modaliases.
      Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Jean Delvare <khali@linux-fr.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      75368bf6
  29. 12 6月, 2009 1 次提交
  30. 25 3月, 2009 1 次提交
    • E
      platform: introduce module id table for platform devices · 57fee4a5
      Eric Miao 提交于
      Now platform_device is being widely used on SoC processors where the
      peripherals are attached to the system bus, which is simple enough.
      
      However, silicon IPs for these SoCs are usually shared heavily across
      a family of processors, even products from different companies.  This
      makes the original simple driver name based matching insufficient, or
      simply not straight-forward.
      
      Introduce a module id table for platform devices, and makes it clear
      that a platform driver is able to support some shared IP and handle
      slight differences across different platforms (by 'driver_data').
      Module alias is handled automatically when a MODULE_DEVICE_TABLE()
      is defined.
      
      To not disturb the current platform drivers too much, the matched id
      entry is recorded and can be retrieved by platform_get_device_id().
      Signed-off-by: NEric Miao <eric.miao@marvell.com>
      Cc: Kay Sievers <kay.sievers@vrfy.org>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      57fee4a5
  31. 17 2月, 2009 1 次提交
  32. 21 1月, 2009 1 次提交
  33. 15 10月, 2008 1 次提交