aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-05-08KVM: arm64: vgic-v3: KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLESEric Auger5-0/+74
This patch adds a new attribute to GICV3 KVM device KVM_DEV_ARM_VGIC_GRP_CTRL group. This allows userspace to flush all GICR pending tables into guest RAM. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Fix pending table syncEric Auger1-12/+12
In its_sync_lpi_pending_table() we currently ignore the target_vcpu of the LPIs. We sync the pending bit found in the vcpu pending table even if the LPI is not targeting it. Also in vgic_its_cmd_handle_invall() we are supposed to read the config table data for the LPIs associated to the collection ID. At the moment we refresh all LPI config information. This patch passes a vpcu to vgic_copy_lpi_list() so that this latter returns a snapshot of the LPIs targeting this CPU and only those. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: ITT save and restoreEric Auger2-3/+117
Implement routines to save and restore device ITT and their interrupt table entries (ITE). Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Device table save/restoreEric Auger2-5/+199
This patch saves the device table entries into guest RAM. Both flat table and 2 stage tables are supported. DeviceId indexing is used. For each device listed in the device table, we also save the translation table using the vgic_its_save/restore_itt routines. Those functions will be implemented in a subsequent patch. On restore, devices are re-allocated and their itt are re-built. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: vgic_its_check_id returns the entry's GPAEric Auger1-3/+8
As vgic_its_check_id() computes the device/collection entry's GPA, let's return it so that new callers can retrieve it easily. Signed-off-by: Eric Auger <[email protected]> Acked-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Collection table save/restoreEric Auger2-2/+107
The save path copies the collection entries into guest RAM at the GPA specified in the BASER register. This obviously requires the BASER to be set. The last written element is a dummy collection table entry. We do not index by collection ID as the collection entry can fit into 8 bytes while containing the collection ID. On restore path we re-allocate the collection objects. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Add infrastructure for table lookupEric Auger1-0/+92
Add a generic scan_its_table() helper whose role consists in scanning a contiguous table located in guest RAM and applying a callback on each entry. Entries can be handled as linked lists since the callback may return an id offset to the next entry and also indicate whether the entry is the last one. Helper functions also are added to compute the device/event ID offset to the next DTE/ITE. compute_next_devid_offset, compute_next_eventid_offset and scan_table will become static in subsequent patches Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: vgic_its_alloc_ite/deviceEric Auger1-21/+47
Add two new helpers to allocate an its ite and an its device. This will avoid duplication on restore path. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: KVM_DEV_ARM_ITS_SAVE/RESTORE_TABLESEric Auger3-6/+109
Introduce new attributes in KVM_DEV_ARM_VGIC_GRP_CTRL group: - KVM_DEV_ARM_ITS_SAVE_TABLES: saves the ITS tables into guest RAM - KVM_DEV_ARM_ITS_RESTORE_TABLES: restores them into VGIC internal structures. We hold the vcpus lock during the save and restore to make sure no vcpu is running. At this stage the functionality is not yet implemented. Only the skeleton is put in place. Signed-off-by: Eric Auger <[email protected]> [Given we will move the iodev register until setting the base addr] Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Read config and pending bit in add_lpi()Eric Auger1-11/+24
When creating the lpi we now ask the redistributor what is the state of the LPI (priority, enabled, pending). Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-v3: vgic_v3_lpi_sync_pending_statusEric Auger4-4/+49
this new helper synchronizes the irq pending_latch with the LPI pending bit status found in rdist pending table. As the status is consumed, we reset the bit in pending table. As we need the PENDBASER_ADDRESS() in vgic-v3, let's move its definition in the irqchip header. We restore the full length of the field, ie [51:16]. Same for PROPBASER_ADDRESS with full field length of [51:12]. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Check the device id matches TYPER DEVBITS rangeEric Auger1-5/+20
On MAPD we currently check the device id can be stored in the device table. Let's first check it can be encoded within the range defined by TYPER DEVBITS. Also check the collection ID belongs to the 16 bit range as GITS_TYPER CIL field equals to 0. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Interpret MAPD ITT_addr fieldEric Auger1-0/+4
Up to now the MAPD ITT_addr had been ignored. We will need it for save/restore. Let's record it in the its_device struct. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Interpret MAPD Size field and check related errorsEric Auger2-1/+16
Up to now the MAPD's ITT size field has been ignored. It encodes the number of eventid bit minus 1. It should be used to check the eventid when a MAPTI command is issued on a device. Let's store the number of eventid bits in the its_device and do the check on MAPTI. Also make sure the ITT size field does not exceed the GITS_TYPER IDBITS field. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_iidrEric Auger2-3/+25
The GITS_IIDR revision field is used to encode the migration ABI revision. So we need to restore it to check the table layout is readable by the destination. By writing the IIDR, userspace thus forces the ABI revision to be used and this must be less than or equal to the max revision KVM supports. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Introduce migration ABI infrastructureEric Auger3-4/+97
We plan to support different migration ABIs, ie. characterizing the ITS table layout format in guest RAM. For example, a new ABI will be needed if vLPIs get supported for nested use case. So let's introduce an array of supported ABIs (at the moment a single ABI is supported though). The following characteristics are foreseen to vary with the ABI: size of table entries, save/restore operation, the way abi settings are applied. By default the MAX_ABI_REV is applied on its creation. In subsequent patches we will introduce a way for the userspace to change the ABI in use. The entry sizes now are set according to the ABI version and not hardcoded anymore. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Implement vgic_mmio_uaccess_write_its_creadrEric Auger1-2/+40
GITS_CREADR needs to be restored so let's implement the associated uaccess_write_its callback. The write only is allowed if the its is disabled. Signed-off-by: Eric Auger <[email protected]> Acked-by: Marc Zyngier <[email protected]> Reviewed-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: Implement vgic_its_has_attr_regs and attr_regs_accessEric Auger2-4/+84
This patch implements vgic_its_has_attr_regs and vgic_its_attr_regs_access upon the MMIO framework. VGIC ITS KVM device KVM_DEV_ARM_VGIC_GRP_ITS_REGS group becomes functional. At least GITS_CREADR and GITS_IIDR require to differentiate a guest write action from a user access. As such let's introduce a new uaccess_its_write vgic_register_region callback. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Reviewed-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm/arm64: vgic: expose (un)lock_all_vcpusEric Auger2-2/+5
We need to use those helpers in vgic-its.c so let's expose them in the private vgic header. Signed-off-by: Eric Auger <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm64: vgic-its: KVM_DEV_ARM_VGIC_GRP_ITS_REGS groupEric Auger3-1/+37
The ITS KVM device exposes a new KVM_DEV_ARM_VGIC_GRP_ITS_REGS group which allows the userspace to save/restore ITS registers. At this stage the get/set/has operations are not yet implemented. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Reviewed-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
2017-05-08arm/arm64: vgic: turn vgic_find_mmio_region into publicEric Auger2-6/+10
We plan to use vgic_find_mmio_region in vgic-its.c so let's turn it into a public function. Also let's take the opportunity to rename the region parameter into regions to emphasize this latter is an array of regions. Signed-off-by: Eric Auger <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm/arm64: vgic-its: rename itte into iteEric Auger1-74/+74
The actual abbreviation for the interrupt translation table entry is ITE. Let's rename all itte instances by ite. Signed-off-by: Eric Auger <[email protected]> Acked-by: Marc Zyngier <[email protected]> Acked-by: Christoffer Dall <[email protected]>
2017-05-08KVM: arm/arm64: Add GICV3 pending table save API documentationEric Auger1-0/+6
Add description for how to save GICV3 LPI pending bit into guest RAM pending tables. Signed-off-by: Eric Auger <[email protected]> Acked-by: Christoffer Dall <[email protected]> Acked-by: Marc Zyngier <[email protected]>
2017-05-08KVM: arm/arm64: Add ITS save/restore API documentationEric Auger1-0/+120
Add description for how to access ITS registers and how to save/restore ITS tables into/from memory. Reviewed-by: Christoffer Dall <[email protected]> Signed-off-by: Eric Auger <[email protected]>
2017-05-08cfg80211: fix multi scheduled scan kernel-docJohannes Berg1-1/+1
Replace @results_wk with @report_results, which was missed in an earlier patch between revisions thereof. Fixes: b34939b98369 ("cfg80211: add request id to cfg80211_sched_scan_*() api") Signed-off-by: Johannes Berg <[email protected]> Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2017-05-08mac80211: fix IBSS presp allocation sizeJohannes Berg1-0/+2
When VHT IBSS support was added, the size of the extra elements wasn't considered in ieee80211_ibss_build_presp(), which makes it possible that it would overrun the allocated buffer. Fix it by allocating the necessary space. Fixes: abcff6ef01f9 ("mac80211: add VHT support for IBSS") Reported-by: Shaul Triebitz <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2017-05-08nl80211: correctly validate MU-MIMO groupsJohannes Berg1-2/+2
Since groups 0 and 63 are invalid, we should check for those bits. Note that the 802.11 spec specifies the *bit* order, but the CPU doesn't care about bit order since it can't address bits, so it's always treating BIT(0) as the lowest bit within a byte. Reported-by: Jan Fuchs <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2017-05-08mac80211: bail out from prep_connection() if a reconfig is ongoingLuca Coelho1-0/+4
If ieee80211_hw_restart() is called during authentication, the authentication process will continue, causing the driver to be called in a wrong state. This ultimately causes an oops in the iwlwifi driver (at least). This fixes bugzilla 195299 partly. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195299 Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
2017-05-08nios2: use generic strncpy_from_user() and strnlen_user()Ley Foon Tan3-35/+7
This change enables the generic strncpy_from_user() and strnlen_user() Signed-off-by: Ley Foon Tan <[email protected]>
2017-05-08mac80211: properly remove RX_ENC_FLAG_40MHZJohannes Berg6-8/+16
Somehow I missed this in my RX rate cleanup series, causing some drivers to not report correct bandwidth since this flag isn't used by mac80211 anymore. Fix this, and make hwsim also report higher bandwidths appropriately. Signed-off-by: Johannes Berg <[email protected]>
2017-05-08nios2: Add CDX supportMarek Vasut4-2/+19
Add support for the CDX Code Density Extensions present in Nios II R2 . This introduces new 16bit instruction set to improve code density while retaining support for the 32bit Nios II R2 instructions. Signed-off-by: Marek Vasut <[email protected]> Cc: Ley Foon Tan <[email protected]>
2017-05-08nios2: Add BMX supportMarek Vasut4-2/+19
Add support for the BMX Bit Manipulation Extensions present in Nios II R2 . This introduces three new instructions, EXTRACT, INSERT and MERGE. Signed-off-by: Marek Vasut <[email protected]> Cc: Ley Foon Tan <[email protected]>
2017-05-08nios2: Add NIOS2_ARCH_REVISION to select between R1 and R2Marek Vasut3-0/+13
Allow user to select between Nios2 R1 and R2. Since R1 and R2 are not binary compatible, we cannot have a single kernel binary and there is no point in having DT property for discerning these two. Signed-off-by: Marek Vasut <[email protected]> Cc: Ley Foon Tan <[email protected]>
2017-05-08nios2: implement flush_dcache_mmap_lock/unlockJulien Beraud1-2/+4
Use spin_lock/unlock_irq instead of doing nothing. This fixes corruptions of the vma_interval_tree causing the kernel to be stuck in an infinite loop in vma_interval_tree_foreach. Signed-off-by: Julien Beraud <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2017-05-08nios2: enable earlycon supportTobias Klauser4-4/+9
Enable generic earlycon support for nios2. This e.g. allows to use a 8250/16650 UART as earlycon. In order to get the earlycon, we just need to call parse_early_param() in early_init_devtree() as soon as the device tree is initially scanned. By adding an stdout-path property to the dts (done in this patch for 10m50_devboard), the earlycon can be used. In order to provide early printk support, we need to provide a dummy implementation of early_console_write(), so that arch/nios2/kernel/early_printk.c can still be compiled if neither SERIAL_ALTERA_JTAGUART_CONSOLE nor SERIAL_ALTERA_UART_CONSOLE is selected. As soon as the altera_uart and altera_jtaguart support earlycon, the entire file can be removed. Tested-by: Guenter Roeck <[email protected]> Signed-off-by: Tobias Klauser <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2017-05-08nios2: constify irq_domain_opsTobias Klauser1-1/+1
struct irq_domain_ops is not modified, so it can be made const. Signed-off-by: Tobias Klauser <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2017-05-08nios2: remove wrapper header for cmpxchg.hTobias Klauser2-14/+1
Since commit 713e9b802e21 ("nios2: Switch to generic __xchg()") asm/cmpxchg.h for nios2 is merely including asm-generic/cmpxchg.h. Thus, the wrapper can be omitted and the generic header can be used directly. Signed-off-by: Tobias Klauser <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2017-05-08nios2: add .gitignore entries for auto-generated filesTobias Klauser2-0/+3
Add .gitignore entries for nios2 specific files generated during the build process. Signed-off-by: Tobias Klauser <[email protected]> Acked-by: Ley Foon Tan <[email protected]>
2017-05-08ALSA: hda - Add mute led support for HP EliteBook 840 G3Florin Tudorache1-1/+3
Signed-off-by: Florin Tudorache <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2017-05-08x86/kexec/64: Use gbpages for identity mappings if availableXunlei Pang1-0/+4
Kexec sets up all identity mappings before booting into the new kernel, and this will cause extra memory consumption for paging structures which is quite considerable on modern machines with huge memory sizes. E.g. on a 32TB machine that is kdumping, it could waste around 128MB (around 4MB/TB) from the reserved memory after kexec sets all the identity mappings using the current 2MB page. Add to that the memory needed for the loaded kdump kernel, initramfs, etc., and it causes a kexec syscall -NOMEM failure. As a result, we had to enlarge reserved memory via "crashkernel=X" to work around this problem. This causes some trouble for distributions that use policies to evaluate the proper "crashkernel=X" value for users. So enable gbpages for kexec mappings. Signed-off-by: Xunlei Pang <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Young <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Eric Biederman <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2017-05-08x86/mm: Add support for gbpages to kernel_ident_mapping_init()Xunlei Pang5-5/+18
Kernel identity mappings on x86-64 kernels are created in two ways: by the early x86 boot code, or by kernel_ident_mapping_init(). Native kernels (which is the dominant usecase) use the former, but the kexec and the hibernation code uses kernel_ident_mapping_init(). There's a subtle difference between these two ways of how identity mappings are created, the current kernel_ident_mapping_init() code creates identity mappings always using 2MB page(PMD level) - while the native kernel boot path also utilizes gbpages where available. This difference is suboptimal both for performance and for memory usage: kernel_ident_mapping_init() needs to allocate pages for the page tables when creating the new identity mappings. This patch adds 1GB page(PUD level) support to kernel_ident_mapping_init() to address these concerns. The primary advantage would be better TLB coverage/performance, because we'd utilize 1GB TLBs instead of 2MB ones. It is also useful for machines with large number of memory to save paging structure allocations(around 4MB/TB using 2MB page) when setting identity mappings for all the memory, after using 1GB page it will consume only 8KB/TB. ( Note that this change alone does not activate gbpages in kexec, we are doing that in a separate patch. ) Signed-off-by: Xunlei Pang <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Dave Young <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: Eric Biederman <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2017-05-07lightnvm: remove unused rq parameter of nvme_nvm_rqtocmd() to kill warningGeert Uytterhoeven1-3/+3
With gcc 4.1.2: drivers/nvme/host/lightnvm.c: In function ‘nvme_nvm_submit_io’: drivers/nvme/host/lightnvm.c:498: warning: ‘rq’ is used uninitialized in this function Indeed, since commit 2e13f33a2464fc3a ("lightnvm: create cmd before allocating request"), the request is passed to nvme_nvm_rqtocmd() before it is allocated. Fortunately, as of commit 91276162de9476b8 ("lightnvm: refactor end_io functions for sync"), nvme_nvm_rqtocmd () no longer uses the passed request, so this warning is a false positive. Drop the unused parameter to clean up the code and kill the warning. Fixes: 2e13f33a2464fc3a ("lightnvm: create cmd before allocating request") Fixes: 91276162de9476b8 ("lightnvm: refactor end_io functions for sync") Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2017-05-07block/mq: fix potential deadlock during cpu hotplugWanpeng Li1-2/+2
This can be triggered by hot-unplug one cpu. ====================================================== [ INFO: possible circular locking dependency detected ] 4.11.0+ #17 Not tainted ------------------------------------------------------- step_after_susp/2640 is trying to acquire lock: (all_q_mutex){+.+...}, at: [<ffffffffb33f95b8>] blk_mq_queue_reinit_work+0x18/0x110 but task is already holding lock: (cpu_hotplug.lock){+.+.+.}, at: [<ffffffffb306d04f>] cpu_hotplug_begin+0x7f/0xe0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (cpu_hotplug.lock){+.+.+.}: lock_acquire+0x11c/0x230 __mutex_lock+0x92/0x990 mutex_lock_nested+0x1b/0x20 get_online_cpus+0x64/0x80 blk_mq_init_allocated_queue+0x3a0/0x4e0 blk_mq_init_queue+0x3a/0x60 loop_add+0xe5/0x280 loop_init+0x124/0x177 do_one_initcall+0x53/0x1c0 kernel_init_freeable+0x1e3/0x27f kernel_init+0xe/0x100 ret_from_fork+0x31/0x40 -> #0 (all_q_mutex){+.+...}: __lock_acquire+0x189a/0x18a0 lock_acquire+0x11c/0x230 __mutex_lock+0x92/0x990 mutex_lock_nested+0x1b/0x20 blk_mq_queue_reinit_work+0x18/0x110 blk_mq_queue_reinit_dead+0x1c/0x20 cpuhp_invoke_callback+0x1f2/0x810 cpuhp_down_callbacks+0x42/0x80 _cpu_down+0xb2/0xe0 freeze_secondary_cpus+0xb6/0x390 suspend_devices_and_enter+0x3b3/0xa40 pm_suspend+0x129/0x490 state_store+0x82/0xf0 kobj_attr_store+0xf/0x20 sysfs_kf_write+0x45/0x60 kernfs_fop_write+0x135/0x1c0 __vfs_write+0x37/0x160 vfs_write+0xcd/0x1d0 SyS_write+0x58/0xc0 do_syscall_64+0x8f/0x710 return_from_SYSCALL_64+0x0/0x7a other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(cpu_hotplug.lock); lock(all_q_mutex); lock(cpu_hotplug.lock); lock(all_q_mutex); *** DEADLOCK *** 8 locks held by step_after_susp/2640: #0: (sb_writers#6){.+.+.+}, at: [<ffffffffb3244aed>] vfs_write+0x1ad/0x1d0 #1: (&of->mutex){+.+.+.}, at: [<ffffffffb32d3a51>] kernfs_fop_write+0x101/0x1c0 #2: (s_active#166){.+.+.+}, at: [<ffffffffb32d3a59>] kernfs_fop_write+0x109/0x1c0 #3: (pm_mutex){+.+...}, at: [<ffffffffb30d2ecd>] pm_suspend+0x21d/0x490 #4: (acpi_scan_lock){+.+.+.}, at: [<ffffffffb34dc3d7>] acpi_scan_lock_acquire+0x17/0x20 #5: (cpu_add_remove_lock){+.+.+.}, at: [<ffffffffb306d6d7>] freeze_secondary_cpus+0x27/0x390 #6: (cpu_hotplug.dep_map){++++++}, at: [<ffffffffb306cfd5>] cpu_hotplug_begin+0x5/0xe0 #7: (cpu_hotplug.lock){+.+.+.}, at: [<ffffffffb306d04f>] cpu_hotplug_begin+0x7f/0xe0 stack backtrace: CPU: 3 PID: 2640 Comm: step_after_susp Not tainted 4.11.0+ #17 Hardware name: Dell Inc. OptiPlex 7040/0JCTF8, BIOS 1.4.9 09/12/2016 Call Trace: dump_stack+0x99/0xce print_circular_bug+0x1fa/0x270 __lock_acquire+0x189a/0x18a0 lock_acquire+0x11c/0x230 ? lock_acquire+0x11c/0x230 ? blk_mq_queue_reinit_work+0x18/0x110 ? blk_mq_queue_reinit_work+0x18/0x110 __mutex_lock+0x92/0x990 ? blk_mq_queue_reinit_work+0x18/0x110 ? kmem_cache_free+0x2cb/0x330 ? anon_transport_class_unregister+0x20/0x20 ? blk_mq_queue_reinit_work+0x110/0x110 mutex_lock_nested+0x1b/0x20 ? mutex_lock_nested+0x1b/0x20 blk_mq_queue_reinit_work+0x18/0x110 blk_mq_queue_reinit_dead+0x1c/0x20 cpuhp_invoke_callback+0x1f2/0x810 ? __flow_cache_shrink+0x160/0x160 cpuhp_down_callbacks+0x42/0x80 _cpu_down+0xb2/0xe0 freeze_secondary_cpus+0xb6/0x390 suspend_devices_and_enter+0x3b3/0xa40 ? rcu_read_lock_sched_held+0x79/0x80 pm_suspend+0x129/0x490 state_store+0x82/0xf0 kobj_attr_store+0xf/0x20 sysfs_kf_write+0x45/0x60 kernfs_fop_write+0x135/0x1c0 __vfs_write+0x37/0x160 ? rcu_read_lock_sched_held+0x79/0x80 ? rcu_sync_lockdep_assert+0x2f/0x60 ? __sb_start_write+0xd9/0x1c0 ? vfs_write+0x1ad/0x1d0 vfs_write+0xcd/0x1d0 SyS_write+0x58/0xc0 ? rcu_read_lock_sched_held+0x79/0x80 do_syscall_64+0x8f/0x710 ? trace_hardirqs_on_thunk+0x1a/0x1c entry_SYSCALL64_slow_path+0x25/0x25 The cpu hotplug path will hold cpu_hotplug.lock and then reinit all exiting queues for blk mq w/ all_q_mutex, however, blk_mq_init_allocated_queue() will contend these two locks in the inversion order. This is due to commit eabe06595d62 (blk/mq: Cure cpu hotplug lock inversion), it fixes a cpu hotplug lock inversion issue because of hotplug rework, however the hotplug rework is still work-in-progress and lives in a -tip branch and mainline cannot yet trigger that splat. The commit breaks the linus's tree in the merge window, so this patch reverts the lock order and avoids to splat linus's tree. Cc: Jens Axboe <[email protected]> Cc: Peter Zijlstra (Intel) <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Wanpeng Li <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2017-05-07IB/srpt: Avoid that aborting a command triggers a kernel warningBart Van Assche1-1/+2
Avoid that the following warning is triggered: WARNING: CPU: 10 PID: 166 at ../drivers/infiniband/ulp/srpt/ib_srpt.c:2674 srpt_release_cmd+0x139/0x140 [ib_srpt] CPU: 10 PID: 166 Comm: kworker/u24:8 Not tainted 4.9.4-1-default #1 Workqueue: tmr-fileio target_tmr_work [target_core_mod] Call Trace: [<ffffffffaa3c4f70>] dump_stack+0x63/0x83 [<ffffffffaa0844eb>] __warn+0xcb/0xf0 [<ffffffffaa0845dd>] warn_slowpath_null+0x1d/0x20 [<ffffffffc06ba429>] srpt_release_cmd+0x139/0x140 [ib_srpt] [<ffffffffc06e4377>] target_release_cmd_kref+0xb7/0x120 [target_core_mod] [<ffffffffc06e4d7f>] target_put_sess_cmd+0x2f/0x60 [target_core_mod] [<ffffffffc06e15e0>] core_tmr_lun_reset+0x340/0x790 [target_core_mod] [<ffffffffc06e4816>] target_tmr_work+0xe6/0x140 [target_core_mod] [<ffffffffaa09e4d3>] process_one_work+0x1f3/0x4d0 [<ffffffffaa09e7f8>] worker_thread+0x48/0x4e0 [<ffffffffaa09e7b0>] ? process_one_work+0x4d0/0x4d0 [<ffffffffaa0a46da>] kthread+0xca/0xe0 [<ffffffffaa0a4610>] ? kthread_park+0x60/0x60 [<ffffffffaa71b775>] ret_from_fork+0x25/0x30 Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: David Disseldorp <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2017-05-07IB/srpt: Fix abort handlingBart Van Assche1-5/+1
Let the target core check the CMD_T_ABORTED flag instead of the SRP target driver. Hence remove the transport_check_aborted_status() call. Since state == SRPT_STATE_CMD_RSP_SENT is something that really should not happen, do not try to recover if srpt_queue_response() is called for an I/O context that is in that state. This patch is a bug fix because the srpt_abort_cmd() call is misplaced - if that function is called from srpt_queue_response() it should either be called before the command state is changed or after the response has been sent. Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Cc: Doug Ledford <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Andy Grover <[email protected]> Cc: David Disseldorp <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2017-05-07target/fileio: Fix zero-length READ and WRITE handlingBart Van Assche1-2/+1
This patch fixes zero-length READ and WRITE handling in target/FILEIO, which was broken a long time back by: Since: commit d81cb44726f050d7cf1be4afd9cb45d153b52066 Author: Paolo Bonzini <[email protected]> Date: Mon Sep 17 16:36:11 2012 -0700 target: go through normal processing for all zero-length commands which moved zero-length READ and WRITE completion out of target-core, to doing submission into backend driver code. To address this, go ahead and invoke target_complete_cmd() for any non negative return value in fd_do_rw(). Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Cc: Andy Grover <[email protected]> Cc: David Disseldorp <[email protected]> Cc: <[email protected]> # v3.7+ Signed-off-by: Nicholas Bellinger <[email protected]>
2017-05-08kbuild: dtbinst: remove unnecessary __dtbs_install_prep targetMasahiro Yamada1-8/+0
Since commit 5399eb9b3908 ("dtbsinstall: don't move target directory out of the way"), the target __dtbs_install_prep is invoked just for creating the install directory, but all the necessary directories are automatically created by: cmd_dtb_install = mkdir -p $(2); cp $< $(2) Signed-off-by: Masahiro Yamada <[email protected]>
2017-05-07Input: xpad - add USB IDs for Mad Catz Brawlstick and Razer SabertoothBenjamin Valentin1-0/+2
Add USB IDs for two more Xbox 360 controllers. I found them in the pull requests for the xboxdrv userspace driver, which seems abandoned. Thanks to psychogony and mkaito for reporting the IDs there! Signed-off-by: Benjamin Valentin <[email protected]> Reviewed-by: Cameron Gutman <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-05-07Input: xpad - sync supported devices with xboxdrvBenjamin Valentin1-0/+13
The userspace xboxdrv driver [0] contains some USB IDs unknown to the kernel driver. I have created a simple script [1] to extract the missing devices and add them to xpad. A quick google search confirmed that all the new devices called Fightstick/pad are Arcade-type devices [2] where the MAP_TRIGGERS_TO_BUTTONS option should apply. There are some similar devices in the existing device table where this flag is not set, but I did refrain from changing those. [0] https://github.com/xboxdrv/xboxdrv/blob/stable/src/xpad_device.cpp [1] http://codepad.org/CHV98BNH [2] https://www.google.com/search?q=SFxT+Fightstick+Pro&tbm=isch Signed-off-by: Benjamin Valentin <[email protected]> Reviewed-by: Cameron Gutman <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>
2017-05-07Input: xpad - sort supported devices by USB IDBenjamin Valentin1-6/+6
Some entries in the table of supported devices are out of order. To not create a mess when adding new ones using a script, sort them first. Signed-off-by: Benjamin Valentin <[email protected]> Reviewed-by: Cameron Gutman <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]>