summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next' of ↵Linus Torvalds2013-09-1244-315/+1645
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds Pull led updates from Bryan Wu: "Sorry for the late pull request, since I'm just back from vacation. LED subsystem updates for 3.12: - pca9633 driver DT supporting and pca9634 chip supporting - restore legacy device attributes for lp5521 - other fixing and updates" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds: (28 commits) leds: wm831x-status: Request a REG resource leds: trigger: ledtrig-backlight: Fix invalid memory access in fb_event notification callback leds-pca963x: Fix device tree parsing leds-pca9633: Rename to leds-pca963x leds-pca9633: Add mutex to the ledout register leds-pca9633: Unique naming of the LEDs leds-pca9633: Add support for PCA9634 leds: lp5562: use LP55xx common macros for device attributes Documentation: leds-lp5521,lp5523: update device attribute information leds: lp5523: remove unnecessary writing commands leds: lp5523: restore legacy device attributes leds: lp5523: LED MUX configuration on initializing leds: lp5523: make separate API for loading engine leds: lp5521: remove unnecessary writing commands leds: lp5521: restore legacy device attributes leds: lp55xx: add common macros for device attributes leds: lp55xx: add common data structure for program Documentation: leds: Fix a typo leds: ss4200: Fix incorrect placement of __initdata leds: clevo-mail: Fix incorrect placement of __initdata ...
| * leds: wm831x-status: Request a REG resourceMark Brown2013-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | The wm831x-status driver was not converted to use a REG resource when they were introduced and the rest of the wm831x drivers converted, causing it to fail to probe due to requesting the wrong resource type. Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org # v3.7+ Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: trigger: ledtrig-backlight: Fix invalid memory access in fb_event ↵Manfred Schlaegl2013-08-261-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | notification callback fb_notifier_callback is called on any event fired by fb_notifier_call_chain. Events may, or may not contain some data (fb_event.data). In case of FB_EVENT_BLANK fb_event.data contains a pointer to an integer holdingthe blank state. The Problem is, that in ledtrig-backlight.c - fb_notifier_callback the pointer to blank state is dereferenced BEFORE the event-type is checked. Obviously this leads to problems with other events than FB_EVENT_BLANK, where fb_event.data is undefined or NULL. It seems, that this problem existed ever since the driver was added. Like in drivers/video/backlight/backlight.c line 43 I would suggest to return immediately on events other than FB_EVENT_BLANK. Signed-off-by: Manfred Schlaegl <manfred.schlaegl@gmx.at> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds-pca963x: Fix device tree parsingRicardo Ribalda Delgado2013-08-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | A malformed device tree could lead into a segmentation fault if the reg value of a led is bigger than the number of leds. A valid device tree could have only information about the last led of the chip. Fix the device tree parsing to handle those cases. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds-pca9633: Rename to leds-pca963xRicardo Ribalda Delgado2013-08-265-159/+160
| | | | | | | | | | | | | | | | The driver now supports the chips pca9633 and pca9634, therefore we rename the files to more generic and meaningul names Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds-pca9633: Add mutex to the ledout registerRicardo Ribalda Delgado2013-08-261-31/+55
| | | | | | | | | | | | | | | | | | | | | | | | To update an LED a register has to be read, updated and writen. If another LED whas been updated at the same time, this could lead into wrong updates. This patch adds a common mutex to all the leds of the same chip to protect the ledout register. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds-pca9633: Unique naming of the LEDsRicardo Ribalda Delgado2013-08-261-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is more than one pca963x chips on the system and there are some LEDs without platform_data names, the driver wont be able to provide unique naming to them. This will cause led_class_dev_register to fail, unregistering all the LEDs of the chip. This patch adds the i2c address to the name of the unnamed LEDs, making them unique. [ 555.346827] ------------[ cut here ]------------ [ 555.346844] WARNING: at /build/linux-voe0Su/linux-3.9.8/fs/sysfs/dir.c:536 sysfs_add_one+0x8b/0x9d() [ 555.346847] Hardware name: QT5022 [ 555.346850] sysfs: cannot create duplicate filename '/class/leds/pca9633:6' [ 555.346853] Modules linked in: qt5038_platform(O+) leds_pca9633(O) hid_generic ledtrig_default_on rfcomm bnep bluetooth binfmt_misc nfsd auth_rpcgss nfs_acl nfs lockd dns_resolver fscache sunrpc nls_utf8 nls_cp437 vfat fat loop fuse joydev hid_multitouch usbhid hid acpi_cpufreq mperf kvm_amd kvm evdev pn533 nfc arc4 microcode pcspkr efivars k10temp ath9k ath9k_common ath9k_hw ath fglrx(PO) mac80211 cfg80211 video rfkill processor thermal_sys sp5100_tco button i2c_piix4 ext4 crc16 jbd2 mbcache sg sd_mod crc_t10dif ahci libahci igb i2c_algo_bit i2c_core dca ptp pps_core ehci_pci ohci_hcd ehci_hcd libata usbcore usb_common scsi_mod [last unloaded: leds_pca963x] [ 555.346940] Pid: 4766, comm: insmod Tainted: P W O 3.9-1-amd64 #1 Debian 3.9.8-1 [ 555.346943] Call Trace: [ 555.346956] [<ffffffff8103d153>] ? warn_slowpath_common+0x76/0x8c [ 555.346962] [<ffffffff8103d202>] ? warn_slowpath_fmt+0x47/0x49 [ 555.346968] [<ffffffff8116005d>] ? sysfs_pathname+0x3b/0x41 [ 555.346973] [<ffffffff81160767>] ? sysfs_add_one+0x8b/0x9d [ 555.346978] [<ffffffff811610a4>] ? sysfs_do_create_link_sd+0xe8/0x174 [ 555.346985] [<ffffffff81279250>] ? device_add+0x243/0x5ab [ 555.346991] [<ffffffff81060a16>] ? complete_all+0x31/0x40 [ 555.346998] [<ffffffff8104991a>] ? init_timer_key+0xc/0x56 [ 555.347004] [<ffffffff8127964c>] ? device_create_vargs+0x82/0xb6 [ 555.347009] [<ffffffff812796af>] ? device_create+0x2f/0x31 [ 555.347014] [<ffffffff81060add>] ? should_resched+0x5/0x23 [ 555.347021] [<ffffffff812a3a92>] ? led_classdev_register+0x24/0x103 [ 555.347028] [<ffffffffa09d01c0>] ? pca9633_probe+0x173/0x239 [leds_pca9633] [ 555.347035] [<ffffffff8127b504>] ? __driver_attach+0x73/0x73 [ 555.347049] [<ffffffffa009dfc9>] ? i2c_device_probe+0x63/0x88 [i2c_core] [ 555.347057] [<ffffffff8127b373>] ? driver_probe_device+0x92/0x1b0 [ 555.347064] [<ffffffff81279c5c>] ? bus_for_each_drv+0x43/0x7d [ 555.347070] [<ffffffff8127b2af>] ? device_attach+0x68/0x83 [ 555.347078] [<ffffffff8127a990>] ? bus_probe_device+0x25/0x8d [ 555.347083] [<ffffffff812793f7>] ? device_add+0x3ea/0x5ab [ 555.347088] [<ffffffff81060a16>] ? complete_all+0x31/0x40 [ 555.347094] [<ffffffff8104991a>] ? init_timer_key+0xc/0x56 [ 555.347104] [<ffffffffa009d3a1>] ? i2c_new_device+0x10d/0x179 [i2c_core] [ 555.347112] [<ffffffffa008f036>] ? qt5038_init+0x36/0x1000 [qt5038_platform] [ 555.347119] [<ffffffffa008f000>] ? 0xffffffffa008efff [ 555.347125] [<ffffffff8100209e>] ? do_one_initcall+0x74/0x128 [ 555.347131] [<ffffffffa008f000>] ? 0xffffffffa008efff [ 555.347137] [<ffffffff810836f5>] ? load_module+0x1af7/0x1dfc [ 555.347144] [<ffffffff810801c5>] ? free_notes_attrs+0x3c/0x3c [ 555.347150] [<ffffffff81083a98>] ? sys_init_module+0x9e/0xab [ 555.347157] [<ffffffff8138be29>] ? system_call_fastpath+0x16/0x1b [ 555.347161] ---[ end trace ad00b85794e0de4d ]--- [ 555.347448] leds-pca9633: probe of 0-006b failed with error -17 Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds-pca9633: Add support for PCA9634Ricardo Ribalda Delgado2013-08-263-41/+85
| | | | | | | | | | | | | | | | Add support for PCA9634 chip, which belongs to the same family as the 9633 but with support for 8 outputs instead of 4. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5562: use LP55xx common macros for device attributesMilo Kim2013-08-261-2/+2
| | | | | | | | | | Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * Documentation: leds-lp5521,lp5523: update device attribute informationMilo Kim2013-08-262-2/+39
| | | | | | | | | | | | | | | | | | Now, all legacy application interfaces are restored. Each driver documentation is updated. Cc: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5523: remove unnecessary writing commandsMilo Kim2013-08-261-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reduces the number of programming commands. (Count of sending commands) Old code: 32 + program size (32 counts for clearing program memory) New code: 32 Pattern buffer is initialized to 0 in this function. Just update new program data and remaining buffers are filled with 0. So it's needless to clear whole area. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5523: restore legacy device attributesMilo Kim2013-08-261-4/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git commit db6eaf8388a413a5ee1b4547ce78506b9c6456b0 (leds-lp5523: use generic firmware interface) causes an application conflict. This interface should be maintained for compatibility. Restored device attributes are 'engineN_mode', 'engineN_load' and 'engineN_leds'. (N = 1, 2 or 3) A 'selftest' attribute macro is replaced with LP55xx common macro. Those are accessed when a LED pattern is run by an application. Use a mutex in lp5523_update_program_memory() : This function is called when an user-application writes a 'engineN_load' file or pattern data is loaded from generic firmware interface. So, writing program memory should be protected. If an error occurs on accessing this area, just it returns as -EINVAL quickly. This error code is exact same as old driver function, lp5523_do_store_load() because it should be kept for an user-application compatibility. Even the driver is changed, we can use the application without re-compiling sources. Reported-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5523: LED MUX configuration on initializingMilo Kim2013-08-261-1/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LED MUX start and stop address should be updated in the program memory on LP5523 initialization. LED pattern doesn't work without additional MUX address configuration. This handling is done by new function, lp5523_init_program_engine(). Eventually, it's called during device initialization, lp5523_post_init_device(). This is a conflict after git commit 632418bf65503405df3f9a6a1616f5a95f91db85 (leds-lp5523: clean up lp5523_configure()). So it should be fixed. Cc: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5523: make separate API for loading engineMilo Kim2013-08-261-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lp5523_load_engine() It is called whenever the operation mode is changed to 'load'. It is used for simple operation mode change. It will be used when engine mode and LED selection is updated in later patch. lp5523_load_engine_and_select_page() Change the operation mode to 'load' and select program page number. This is used for programming a LED pattern at a time. So load_engine() is replaced with new API, load_engine_and_select_page() in lp5523_firmware_loaded(). Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5521: remove unnecessary writing commandsMilo Kim2013-08-261-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reduces the number of programming commands. (Count of sending commands) Old code: 32 + program size (32 counts for clearing program memory) New code: 32 Pattern buffer is initialized to 0 in this function. Just update new program data and remaining buffers are filled with 0. So it's needless to clear whole area. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp5521: restore legacy device attributesMilo Kim2013-08-261-4/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git commit 9ce7cb170f97f83a78dc948bf7d25690f15e1328 may cause an application confict, engineN_mode and engineN_load. This interface should be maintained for compatibility. Restored device attributes are 'engineN_mode' and 'engineN_load'. A 'selftest' attribute macro is replaced with LP55xx common macro. Use a mutex in lp5521_update_program_memory() : This function is called when an user-application writes a 'engineN_load' file or pattern data is loaded from generic firmware interface. So, writing program memory should be protected. If an error occurs on accessing this area, just it returns as -EINVAL quickly. This error code is exact same as old driver function, lp5521_do_store_load() because it should be kept for an user-application compatibility. Even the driver is changed, we can use the application without re-compiling sources. 'led_pattern' attribute is not included : engineN_mode and _load were created for custom user-application. 'led_pattern' is an exception. I added this attribute not for custom application but for simple test. Now it is used only in LP5562 driver, not LP5521. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp55xx: add common macros for device attributesMilo Kim2013-08-261-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch provides common macros for LP5521 and LP5523 device attributes and functions. (Device attributes) LP5521: 'mode', 'load' and 'selftest' LP5523: 'mode', 'load', 'leds' and 'selftest' (Permissions) mode: R/W load: Write-only leds: R/W selftest: Read-only Couple of lines are duplicate, so use these macros for adding device attributes in LP5521 and LP5523 drivers. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: lp55xx: add common data structure for programMilo Kim2013-08-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | LP55xx family devices have internal three program engines which are used for loading LED patterns. To maintain legacy device attributes, specific data structure is used, 'mode' and 'led_mux'. The mode is used for showing/storing current engine mode such like disabled, load and run. Then led_mux is used for showing/storing current output LED selection. This is only for LP5523/55231. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * Documentation: leds: Fix a typoSachin Kamat2013-08-262-2/+2
| | | | | | | | | | | | | | | | | | __initdata should be placed between the variable name and equal sign for the variable to be placed in the intended section. Fix the example. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: ss4200: Fix incorrect placement of __initdataSachin Kamat2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | __initdata should be placed between the variable name and equal sign for the variable to be placed in the intended section. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Dave Hansen <dave@sr71.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: clevo-mail: Fix incorrect placement of __initdataSachin Kamat2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | __initdata should be placed between the variable name and equal sign for the variable to be placed in the intended section. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Márton Németh <nm127@freemail.hu> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: leds-netxbig: depends on ARCH_KIRKWOODSimon Guinot2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-netxbig by ARCH_KIRKWOOD. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: leds-ns2: depends on ARCH_KIRKWOODSimon Guinot2013-08-261-4/+1
| | | | | | | | | | | | | | | | | | | | With the DT conversion, the board Kconfig symbols MACH_ are going to be removed. In order to prepare this removal, this patch replaces alls the machines dependencies for leds-ns2 by ARCH_KIRKWOOD. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Acked-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: leds-lp3944, fix "sparse" warning "mixing different enum types"Antonio Ospite2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a warning from "sparse": drivers/leds/leds-lp3944.c:292:23: warning: mixing different enum types drivers/leds/leds-lp3944.c:292:23: int enum led_brightness versus drivers/leds/leds-lp3944.c:292:23: int enum lp3944_status Keeping track of LP3944_LED_STATUS_OFF and LP3944_LED_STATUS_ON only in lp3944_led_set_brightness() is OK, as the handling of DIM (blinking) mode[s] is in lp3944_led_set_blink(). Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> Reviewed-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: leds-ss4200: Staticize nasgpio_led_get_attr()Jingoo Han2013-08-261-1/+1
| | | | | | | | | | | | | | | | | | | | nasgpio_led_get_attr() is used only in this file. Fix the following sparse warning: drivers/leds/leds-ss4200.c:200:5: warning: symbol 'nasgpio_led_get_attr' was not declared. Should it be static? Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: use dev_get_platdata()Jingoo Han2013-08-2630-49/+52
| | | | | | | | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: pca9633: Add hardware blink supportMark A. Greer2013-08-263-4/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add hardware blinking support to the pca9633 driver. NOTE: Hardware blinking violates the leds infrastructure driver interface since the hardware only supports blinking all LEDs with the same delay_on/delay_off rates. That is, only the LEDs that are set to blink will actually blink but all LEDs that are set to blink will blink in identical fashion. The delay_on/delay_off values of the last LED that is set to blink will be used for all of the blinking LEDs. If the hardware doesn't support the requested blinking pattern, a default of 500ms on and off will be used. Hardware blinking is disabled by default but can be enabled by setting the 'blink_type' member in the platform_data struct to 'PCA9633_HW_BLINK' or by adding the 'nxp,hw-blink' property to the DTS. (fengguang.wu@intel.com: Removes unneeded semicolon.) Signed-off-by: Mark A. Greer <mgreer@animalcreek.com> Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: support new LP8501 device - another LP55xx commonKim, Milo2013-08-267-7/+537
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LP8501 can drive up to 9 channels like LP5523. LEDs can be controlled directly via the I2C and programmable engines are supported. LP55xx common driver LP8501 is one of LP55xx family device, so LP55xx common code are used. Chip specific data is defined in the structure, 'lp55xx_device_config'. Differences between LP8501 and LP5523 Different register layout for LED output control and others. LP8501 specific feature for separate output power selection. LP8501 doesn't support external clock detection. Different programming engine data. LP8501 specific feature - output power selection Output channels are selected by power selection - Vout or Vdd. Separate power for VDD1-6 and VDD7-9 are available. It is configurable in the platform data. To support this feature, LP55xx DT structure and header are changed. Device tree binding is updated as well. LED pattern data Example pattern data is updated in the driver documentation. Signed-off-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
| * leds: Add device tree binding for pca9633Tony Lindgren2013-08-262-0/+116
| | | | | | | | | | | | | | | | | | | | Similar to tca6507, we can just parse the standard LED properties for pca9633. Tested on a pca9632, which is compatible with pca9633. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
* | Merge tag 'iommu-updates-v3.12' of ↵Linus Torvalds2013-09-1215-120/+3145
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu Pull IOMMU Updates from Joerg Roedel: "This round the updates contain: - A new driver for the Freescale PAMU IOMMU from Varun Sethi. This driver has cooked for a while and required changes to the IOMMU-API and infrastructure that were already merged before. - Updates for the ARM-SMMU driver from Will Deacon - Various fixes, the most important one is probably a fix from Alex Williamson for a memory leak in the VT-d page-table freeing code In summary not all that much. The biggest part in the diffstat is the new PAMU driver" * tag 'iommu-updates-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: intel-iommu: Fix leaks in pagetable freeing iommu/amd: Fix resource leak in iommu_init_device() iommu/amd: Clean up unnecessary MSI/MSI-X capability find iommu/arm-smmu: Simplify VMID and ASID allocation iommu/arm-smmu: Don't use VMIDs for stage-1 translations iommu/arm-smmu: Tighten up global fault reporting iommu/arm-smmu: Remove broken big-endian check iommu/fsl: Remove unnecessary 'fsl-pamu' prefixes iommu/fsl: Fix whitespace problems noticed by git-am iommu/fsl: Freescale PAMU driver and iommu implementation. iommu/fsl: Add additional iommu attributes required by the PAMU driver. powerpc: Add iommu domain pointer to device archdata iommu/exynos: Remove dead code (set_prefbuf)
| | \
| | \
| | \
| | \
| | \
| | \
| | \
| | \
| *-------. \ Merge branches 'arm/exynos', 'ppc/pamu', 'arm/smmu', 'x86/amd' and ↵Joerg Roedel2013-09-1215-120/+3145
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 'iommu/fixes' into next
| | | | | | * | intel-iommu: Fix leaks in pagetable freeingAlex Williamson2013-08-141-37/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At best the current code only seems to free the leaf pagetables and the root. If you're unlucky enough to have a large gap (like any QEMU guest with more than 3G of memory), only the first chunk of leaf pagetables are freed (plus the root). This is a massive memory leak. This patch re-writes the pagetable freeing function to use a recursive algorithm and manages to not only free all the pagetables, but does it without any apparent performance loss versus the current broken version. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | | * | | iommu/amd: Fix resource leak in iommu_init_device()Radmila Kompová2013-08-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detected by cppcheck. Signed-off-by: Kamil Dudka <kdudka@redhat.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | | * | | iommu/amd: Clean up unnecessary MSI/MSI-X capability findYijing Wang2013-08-141-1/+1
| | | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCI core will initialize device MSI/MSI-X capability in pci_msi_init_pci_dev(). So device driver should use pci_dev->msi_cap/msix_cap to determine whether the device support MSI/MSI-X instead of using pci_find_capability(pci_dev, PCI_CAP_ID_MSI/MSIX). Access to PCIe device config space again will consume more time. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Cc: Joerg Roedel <joro@8bytes.org> Cc: iommu@lists.linux-foundation.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | * | | iommu/arm-smmu: Simplify VMID and ASID allocationWill Deacon2013-08-141-22/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only use ASIDs and VMIDs to identify individual stage-1 and stage-2 context-banks respectively, so rather than allocate these separately from the context-banks, just calculate them based on the context bank index. Note that VMIDs are offset by 1, since VMID 0 is reserved for stage-1. This doesn't cause us any issues with the numberspaces, since the maximum number of context banks is half the minimum number of VMIDs. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | * | | iommu/arm-smmu: Don't use VMIDs for stage-1 translationsWill Deacon2013-08-141-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although permitted by the architecture, using VMIDs for stage-1 translations causes a complete nightmare for hypervisors, who end up having to virtualise the VMID space across VMs, which may be using multiple VMIDs each. To make life easier for hypervisors (which might just decide not to support this VMID virtualisation), this patch reworks the stage-1 context-bank TLB invalidation so that: - Stage-1 mappings are marked non-global in the ptes - Each Stage-1 context-bank is assigned an ASID in TTBR0 - VMID 0 is reserved for Stage-1 context-banks This allows the hypervisor to overwrite the Stage-1 VMID in the CBAR when trapping the write from the guest. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | * | | iommu/arm-smmu: Tighten up global fault reportingWill Deacon2013-08-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On systems which use a single, combined irq line for the SMMU, context faults may result in us spuriously reporting global faults with zero status registers. This patch fixes up the fsr checks in both the context and global fault interrupt handlers, so that we only report the fault if the fsr indicates something did indeed go awry. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | | * | | iommu/arm-smmu: Remove broken big-endian checkWill Deacon2013-08-141-6/+0
| | | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bottom word of the pgd should always be written to the low half of the TTBR, so we don't need to swap anything for big-endian. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | * | | iommu/fsl: Remove unnecessary 'fsl-pamu' prefixesJoerg Roedel2013-08-141-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The file defines a pr_fmt macro, so there is no need to add this prefix to individual messages. Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | * | | iommu/fsl: Fix whitespace problems noticed by git-amJoerg Roedel2013-08-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | * | | iommu/fsl: Freescale PAMU driver and iommu implementation.Varun Sethi2013-08-147-0/+2992
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following is a brief description of the PAMU hardware: PAMU determines what action to take and whether to authorize the action on the basis of the memory address, a Logical IO Device Number (LIODN), and PAACT table (logically) indexed by LIODN and address. Hardware devices which need to access memory must provide an LIODN in addition to the memory address. Peripheral Access Authorization and Control Tables (PAACTs) are the primary data structures used by PAMU. A PAACT is a table of peripheral access authorization and control entries (PAACE).Each PAACE defines the range of I/O bus address space that is accessible by the LIOD and the associated access capabilities. There are two types of PAACTs: primary PAACT (PPAACT) and secondary PAACT (SPAACT).A given physical I/O device may be able to act as one or more independent logical I/O devices (LIODs). Each such logical I/O device is assigned an identifier called logical I/O device number (LIODN). A LIODN is allocated a contiguous portion of the I/O bus address space called the DSA window for performing DSA operations. The DSA window may optionally be divided into multiple sub-windows, each of which may be used to map to a region in system storage space. The first sub-window is referred to as the primary sub-window and the remaining are called secondary sub-windows. This patch provides the PAMU driver (fsl_pamu.c) and the corresponding IOMMU API implementation (fsl_pamu_domain.c). The PAMU hardware driver (fsl_pamu.c) has been derived from the work done by Ashish Kalra and Timur Tabi. [For iommu group support] Acked-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Timur Tabi <timur@tabi.org> Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | * | | iommu/fsl: Add additional iommu attributes required by the PAMU driver.Varun Sethi2013-08-142-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the following domain attributes for the FSL PAMU driver: 1. Added new iommu stash attribute, which allows setting of the LIODN specific stash id parameter through IOMMU API. 2. Added an attribute for enabling/disabling DMA to a particular memory window. 3. Added domain attribute to check for PAMUV1 specific constraints. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | | * | | powerpc: Add iommu domain pointer to device archdataVarun Sethi2013-08-141-0/+3
| | | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an iommu domain pointer to device (powerpc) archdata. Devices are attached to iommu domains and this pointer provides a mechanism to correlate between a device and the associated iommu domain. This field is set when a device is attached to a domain. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Joerg Roedel <joro@8bytes.org>
| | * | | iommu/exynos: Remove dead code (set_prefbuf)Grant Grundler2013-08-141-44/+0
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | exynos_sysmmu_set_prefbuf() is not called any where. Signed-off-by: Grant Grundler <grundler@chromium.org> Reviewed-by: Cho KyongHo <pullip.cho@samsung.com> Signed-off-by: Joerg Roedel <joro@8bytes.org>
* | | | Merge tag 'stable/for-linus-3.12-rc0-tag-three' of ↵Linus Torvalds2013-09-121-6/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip Pull Xen balloon driver bug-fixes from Stefano Stabellini: - fix a preemption bug in xen/balloon.c; - remove an harmful BUG_ON in xen/balloon.c that can trigger in non-erroneous situations. * tag 'stable/for-linus-3.12-rc0-tag-three' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: xen/balloon: remove BUG_ON in increase_reservation xen/balloon: ensure preemption is disabled when using a scratch page
| * | | | xen/balloon: remove BUG_ON in increase_reservationWei Liu2013-09-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BUG_ON in increase_reservation is wrong as we have P2M entry ballooned out page set to balloon scratch page, so it might have a valid P2M entry at that point. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
| * | | | xen/balloon: ensure preemption is disabled when using a scratch pageDavid Vrabel2013-09-111-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In decrease_reservation(), if the kernel is preempted between updating the mapping and updating the p2m then they may end up using different scratch pages. Use get_balloon_scratch_page() and put_balloon_scratch_page() which use get_cpu_var() and put_cpu_var() to correctly disable preemption. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Tested-by: Sander Eikelenboom <linux@eikelenboom.it>
* | | | | Merge tag 'pm+acpi-fixes-3.12-rc1' of ↵Linus Torvalds2013-09-1213-188/+328
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm Pull ACPI and power management fixes from Rafael Wysocki: "All of these commits are fixes that have emerged recently and some of them fix bugs introduced during this merge window. Specifics: 1) ACPI-based PCI hotplug (ACPIPHP) fixes related to spurious events After the recent ACPIPHP changes we've seen some interesting breakage on a system that triggers device check notifications during boot for non-existing devices. Although those notifications are really spurious, we should be able to deal with them nevertheless and that shouldn't introduce too much overhead. Four commits to make that work properly. 2) Memory hotplug and hibernation mutual exclusion rework This was maent to be a cleanup, but it happens to fix a classical ABBA deadlock between system suspend/hibernation and ACPI memory hotplug which is possible if they are started roughly at the same time. Three commits rework memory hotplug so that it doesn't acquire pm_mutex and make hibernation use device_hotplug_lock which prevents it from racing with memory hotplug. 3) ACPI Intel LPSS (Low-Power Subsystem) driver crash fix The ACPI LPSS driver crashes during boot on Apple Macbook Air with Haswell that has slightly unusual BIOS configuration in which one of the LPSS device's _CRS method doesn't return all of the information expected by the driver. Fix from Mika Westerberg, for stable. 4) ACPICA fix related to Store->ArgX operation AML interpreter fix for obscure breakage that causes AML to be executed incorrectly on some machines (observed in practice). From Bob Moore. 5) ACPI core fix for PCI ACPI device objects lookup There still are cases in which there is more than one ACPI device object matching a given PCI device and we don't choose the one that the BIOS expects us to choose, so this makes the lookup take more criteria into account in those cases. 6) Fix to prevent cpuidle from crashing in some rare cases If the result of cpuidle_get_driver() is NULL, which can happen on some systems, cpuidle_driver_ref() will crash trying to use that pointer and the Daniel Fu's fix prevents that from happening. 7) cpufreq fixes related to CPU hotplug Stephen Boyd reported a number of concurrency problems with cpufreq related to CPU hotplug which are addressed by a series of fixes from Srivatsa S Bhat and Viresh Kumar. 8) cpufreq fix for time conversion in time_in_state attribute Time conversion carried out by cpufreq when user space attempts to read /sys/devices/system/cpu/cpu*/cpufreq/stats/time_in_state won't work correcty if cputime_t doesn't map directly to jiffies. Fix from Andreas Schwab. 9) Revert of a troublesome cpufreq commit Commit 7c30ed5 (cpufreq: make sure frequency transitions are serialized) was intended to address some known concurrency problems in cpufreq related to the ordering of transitions, but unfortunately it introduced several problems of its own, so I decided to revert it now and address the original problems later in a more robust way. 10) Intel Haswell CPU models for intel_pstate from Nell Hardcastle. 11) cpufreq fixes related to system suspend/resume The recent cpufreq changes that made it preserve CPU sysfs attributes over suspend/resume cycles introduced a possible NULL pointer dereference that caused it to crash during the second attempt to suspend. Three commits from Srivatsa S Bhat fix that problem and a couple of related issues. 12) cpufreq locking fix cpufreq_policy_restore() should acquire the lock for reading, but it acquires it for writing. Fix from Lan Tianyu" * tag 'pm+acpi-fixes-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (25 commits) cpufreq: Acquire the lock in cpufreq_policy_restore() for reading cpufreq: Prevent problems in update_policy_cpu() if last_cpu == new_cpu cpufreq: Restructure if/else block to avoid unintended behavior cpufreq: Fix crash in cpufreq-stats during suspend/resume intel_pstate: Add Haswell CPU models Revert "cpufreq: make sure frequency transitions are serialized" cpufreq: Use signed type for 'ret' variable, to store negative error values cpufreq: Remove temporary fix for race between CPU hotplug and sysfs-writes cpufreq: Synchronize the cpufreq store_*() routines with CPU hotplug cpufreq: Invoke __cpufreq_remove_dev_finish() after releasing cpu_hotplug.lock cpufreq: Split __cpufreq_remove_dev() into two parts cpufreq: Fix wrong time unit conversion cpufreq: serialize calls to __cpufreq_governor() cpufreq: don't allow governor limits to be changed when it is disabled ACPI / bind: Prefer device objects with _STA to those without it ACPI / hotplug / PCI: Avoid parent bus rescans on spurious device checks ACPI / hotplug / PCI: Use _OST to notify firmware about notify status ACPI / hotplug / PCI: Avoid doing too much for spurious notifies ACPICA: Fix for a Store->ArgX when ArgX contains a reference to a field. ACPI / hotplug / PCI: Don't trim devices before scanning the namespace ...
| * \ \ \ \ Merge branch 'pm-cpufreq'Rafael J. Wysocki2013-09-121-17/+32
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pm-cpufreq: cpufreq: Acquire the lock in cpufreq_policy_restore() for reading cpufreq: Prevent problems in update_policy_cpu() if last_cpu == new_cpu cpufreq: Restructure if/else block to avoid unintended behavior cpufreq: Fix crash in cpufreq-stats during suspend/resume
| | * | | | | cpufreq: Acquire the lock in cpufreq_policy_restore() for readingLan Tianyu2013-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cpufreq_policy_restore() before system suspend policy is read from percpu's cpufreq_cpu_data_fallback. It's a read operation rather than a write one, so take the lock for reading in there. Signed-off-by: Lan Tianyu <tianyu.lan@intel.com> Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
OpenPOWER on IntegriCloud