aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-07-23KVM: vmx: obey KVM_QUIRK_CD_NW_CLEAREDXiao Guangrong1-1/+4
OVMF depends on WB to boot fast, because it only clears caches after it has set up MTRRs---which is too late. Let's do writeback if CR0.CD is set to make it happy, similar to what SVM is already doing. Signed-off-by: Xiao Guangrong <[email protected]> Tested-by: Alex Williamson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2015-07-23KVM: x86: introduce kvm_check_has_quirkPaolo Bonzini3-2/+7
The logic of the disabled_quirks field usually results in a double negation. Wrap it in a simple function that checks the bit and negates it. Based on a patch from Xiao Guangrong. Signed-off-by: Paolo Bonzini <[email protected]>
2015-07-23KVM: MTRR: simplify kvm_mtrr_get_guest_memory_typeXiao Guangrong1-9/+10
kvm_mtrr_get_guest_memory_type never returns -1 which is implied in the current code since if @type = -1 (means no MTRR contains the range), iter.partial_map must be true Simplify the code to indicate this fact Signed-off-by: Xiao Guangrong <[email protected]> Tested-by: Alex Williamson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2015-07-23KVM: MTRR: fix memory type handling if MTRR is completely disabledXiao Guangrong1-1/+20
Currently code uses default memory type if MTRR is fully disabled, fix it by using UC instead. Signed-off-by: Xiao Guangrong <[email protected]> Tested-by: Alex Williamson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
2015-07-22mei: prevent unloading mei hw modules while the device is opened.Tomas Winkler1-1/+1
chrdev_open() increases reference counter on cdev->owner. Instead of assigning the owner to mei subsystem, the owner has to be set to the underlaying HW module (mei_me or mei_txe), so once the device is opened the HW module cannot be unloaded. Cc: <[email protected]> #3.17+ Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: Alexander Usyskin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22misc: mic: scif bug fix for vmalloc_to_page crashSudeep Dutt1-10/+5
v4.2-rc1 enabled huge page support for ioremap(..). Calling vmalloc_to_page after v4.2-rc1 results in the crash shown below on the host upon booting X100 coprocessors: BUG: unable to handle kernel paging request at ffffc47c00000000 IP: [<ffffffff811a2c0c>] vmalloc_to_page+0x6c/0xb0 This patch fixes this crash by obtaining the fake struct page pointer which is required to be passed into dma_map_sg(..) by calling pfn_to_page(..) instead of vmalloc_to_page(..). Link: https://lkml.org/lkml/2015/7/18/110 Reviewed-by: Nikhil Rao <[email protected]> Suggested-by: Toshi Kani <[email protected]> Signed-off-by: Ashutosh Dixit <[email protected]> Signed-off-by: Sudeep Dutt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22parport: fix freeing freed memorySudip Mukherjee1-4/+4
After the reference count becomes 0 when put_device() is called, it will execute the release callback where we are freeing all the allocated memory associated with the device. So if we just continue on the error path then we are again freeing devname and trying to dereference par_dev which has already been free-ed in the release callback. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22parport: fix memory leakSudip Mukherjee1-0/+1
After the reference count becomes 0 when put_device() is called, it will execute the release callback where we are freeing all the allocated memory associated with the device. We missed freeing par_dev->state. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22parport: fix error handlingSudip Mukherjee1-1/+2
After registering the device if exclusive access fails for any reason then we need to unregister the device to remove all references. Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22mnt: Clarify and correct the disconnect logic in umount_treeEric W. Biederman2-6/+31
rmdir mntpoint will result in an infinite loop when there is a mount locked on the mountpoint in another mount namespace. This is because the logic to test to see if a mount should be disconnected in umount_tree is buggy. Move the logic to decide if a mount should remain connected to it's mountpoint into it's own function disconnect_mount so that clarity of expression instead of terseness of expression becomes a virtue. When the conditions where it is invalid to leave a mount connected are first ruled out, the logic for deciding if a mount should be disconnected becomes much clearer and simpler. Fixes: e0c9c0afd2fc958ffa34b697972721d81df8a56f mnt: Update detach_mounts to leave mounts connected Fixes: ce07d891a0891d3c0d0c2d73d577490486b809e1 mnt: Honor MNT_LOCKED when detaching mounts Cc: [email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
2015-07-23md: Skip cluster setup for dm-raidGoldwyn Rodrigues1-3/+12
There is a bug that the bitmap superblock isn't initialised properly for dm-raid, so a new field can have garbage in new fields. (dm-raid does initialisation in the kernel - md initialised the superblock in mdadm). This means that for dm-raid we cannot currently trust the new ->nodes field. So: - use __GFP_ZERO to initialise the superblock properly for all new arrays - initialise all fields in bitmap_info in bitmap_new_disk_sb - ignore ->nodes for dm arrays (yes, this is a hack) This bug exposes dm-raid to bug in the (still experimental) md-cluster code, so it is suitable for -stable. It does cause crashes. References: https://bugzilla.kernel.org/show_bug.cgi?id=100491 Cc: [email protected] (v4.1) Signed-off-By: Goldwyn Rodrigues <[email protected]> Signed-off-by: NeilBrown <[email protected]>
2015-07-22blkcg: fix gendisk reference leak in blkg_conf_prep()Tejun Heo1-1/+5
When a blkcg configuration is targeted to a partition rather than a whole device, blkg_conf_prep fails with -EINVAL; unfortunately, it forgets to put the gendisk ref in that case. Fix it. Signed-off-by: Tejun Heo <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2015-07-22USB: OHCI: fix bad #define in ohci-tmio.cAlan Stern1-1/+1
An incorrect definition of CCR_PM_USBPW3 in ohci-tmio.c is a perennial source of invalid diagnoses from static scanners, such as in <http://marc.info/?l=linux-usb&m=143634574527641&w=2>. This patch fixes the definition. Signed-off-by: Alan Stern <[email protected]> Reported-by: David Binderman <[email protected]> CC: Dmitry Eremin-Solenikov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22cdc-acm: Destroy acm_minors IDR on module exitJohannes Thumshirn1-0/+1
Destroy acm_minors IDR on module exit, reclaiming the allocated memory. This was detected by the following semantic patch (written by Luis Rodriguez <[email protected]>) <SmPL> @ defines_module_init @ declarer name module_init, module_exit; declarer name DEFINE_IDR; identifier init; @@ module_init(init); @ defines_module_exit @ identifier exit; @@ module_exit(exit); @ declares_idr depends on defines_module_init && defines_module_exit @ identifier idr; @@ DEFINE_IDR(idr); @ on_exit_calls_destroy depends on declares_idr && defines_module_exit @ identifier declares_idr.idr, defines_module_exit.exit; @@ exit(void) { ... idr_destroy(&idr); ... } @ missing_module_idr_destroy depends on declares_idr && defines_module_exit && !on_exit_calls_destroy @ identifier declares_idr.idr, defines_module_exit.exit; @@ exit(void) { ... +idr_destroy(&idr); } </SmPL> Signed-off-by: Johannes Thumshirn <[email protected]> Acked-by: Oliver Neukum <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22usb-storage: Add ignore-device quirk for gm12u320 based usb mini projectorsHans de Goede1-0/+11
Grain-media GM12U320 based devices are mini video projectors using USB for both power and video data transport. Their usb-storage interface is a virtual windows driver CD. The gm12u320 kms driver needs these interfaces to talk to the device and export it as framebuffer & kms dri device nodes, so make sure that the usb-storage driver does not bind to it. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22usb-storage: ignore ZTE MF 823 card reader in mode 0x1225Oliver Neukum1-0/+12
This device automatically switches itself to another mode (0x1405) unless the specific access pattern of Windows is followed in its initial mode. That makes a dirty unmount of the internal storage devices inevitable if they are mounted. So the card reader of such a device should be ignored, lest an unclean removal become inevitable. This replaces an earlier patch that ignored all LUNs of this device. That patch was overly broad. Signed-off-by: Oliver Neukum <[email protected]> CC: [email protected] Reviewed-by: Lars Melin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22USB: OHCI: Fix race between ED unlink and URB submissionAlan Stern1-6/+1
This patch fixes a bug introduced by commit 977dcfdc6031 ("USB: OHCI: don't lose track of EDs when a controller dies"). The commit changed ed_state from ED_UNLINK to ED_IDLE too early, before finish_urb() had been called. The user-visible consequence is that the driver occasionally crashes or locks up when an URB is submitted while another URB for the same endpoint is being unlinked. This patch moves the ED state change later, to the right place. The drawback is that now we may unnecessarily execute some instructions multiple times when a controller dies. Since controllers dying is an exceptional occurrence, a little wasted time won't matter. Signed-off-by: Alan Stern <[email protected]> Reported-by: Heiko Przybyl <[email protected]> Tested-by: Heiko Przybyl <[email protected]> Fixes: 977dcfdc60311e7aa571cabf6f39c36dde13339e CC: <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22usb: core: lpm: set lpm_capable for root hub deviceLu Baolu3-3/+7
Commit 25cd2882e2fc ("usb/xhci: Change how we indicate a host supports Link PM.") removed the code to set lpm_capable for USB 3.0 super-speed root hub. The intention of that change was to avoid touching usb core internal field, a.k.a. lpm_capable, and let usb core to set it by checking U1 and U2 exit latency values in the descriptor. Usb core checks and sets lpm_capable in hub_port_init(). Unfortunately, root hub is a special usb device as it has no parent. Hub_port_init() will never be called for a root hub device. That means lpm_capable will by no means be set for the root hub. As the result, lpm isn't functional at all in Linux kernel. This patch add the code to check and set lpm_capable when registering a root hub device. It could be back-ported to kernels as old as v3.15, that contains the Commit 25cd2882e2fc ("usb/xhci: Change how we indicate a host supports Link PM."). Cc: [email protected] # 3.15 Reported-by: Kevin Strasser <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds79-811/+714
Pull networking fixes from David Miller: 1) Don't use shared bluetooth antenna in iwlwifi driver for management frames, from Emmanuel Grumbach. 2) Fix device ID check in ath9k driver, from Felix Fietkau. 3) Off by one in xen-netback BUG checks, from Dan Carpenter. 4) Fix IFLA_VF_PORT netlink attribute validation, from Daniel Borkmann. 5) Fix races in setting peeked bit flag in SKBs during datagram receive. If it's shared we have to clone it otherwise the value can easily be corrupted. Fix from Herbert Xu. 6) Revert fec clock handling change, causes regressions. From Fabio Estevam. 7) Fix use after free in fq_codel and sfq packet schedulers, from WANG Cong. 8) ipvlan bug fixes (memory leaks, missing rcu_dereference_bh, etc.) from WANG Cong and Konstantin Khlebnikov. 9) Memory leak in act_bpf packet action, from Alexei Starovoitov. 10) ARM bpf JIT bug fixes from Nicolas Schichan. 11) Fix backwards compat of ANY_LAYOUT in virtio_net driver, from Michael S Tsirkin. 12) Destruction of bond with different ARP header types not handled correctly, fix from Nikolay Aleksandrov. 13) Revert GRO receive support in ipv6 SIT tunnel driver, causes regressions because the GRO packets created cannot be processed properly on the GSO side if we forward the frame. From Herbert Xu. 14) TCCR update race and other fixes to ravb driver from Sergei Shtylyov. 15) Fix SKB leaks in caif_queue_rcv_skb(), from Eric Dumazet. 16) Fix panics on packet scheduler filter replace, from Daniel Borkmann. 17) Make sure AF_PACKET sees properly IP headers in defragmented frames (via PACKET_FANOUT_FLAG_DEFRAG option), from Edward Hyunkoo Jee. 18) AF_NETLINK cannot hold mutex in RCU callback, fix from Florian Westphal. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (84 commits) ravb: fix ring memory allocation net: phy: dp83867: Fix warning check for setting the internal delay openvswitch: allocate nr_node_ids flow_stats instead of num_possible_nodes netlink: don't hold mutex in rcu callback when releasing mmapd ring ARM: net: fix vlan access instructions in ARM JIT. ARM: net: handle negative offsets in BPF JIT. ARM: net: fix condition for load_order > 0 when translating load instructions. tcp: suppress a division by zero warning drivers: net: cpsw: remove tx event processing in rx napi poll inet: frags: fix defragmented packet's IP header for af_packet net: mvneta: fix refilling for Rx DMA buffers stmmac: fix setting of driver data in stmmac_dvr_probe sched: cls_flow: fix panic on filter replace sched: cls_flower: fix panic on filter replace sched: cls_bpf: fix panic on filter replace net/mdio: fix mdio_bus_match for c45 PHY net: ratelimit warnings about dst entry refcount underflow or overflow caif: fix leaks and race in caif_queue_rcv_skb() qmi_wwan: add the second QMI/network interface for Sierra Wireless MC7305/MC7355 ravb: fix race updating TCCR ...
2015-07-22Merge tag 'phy-for-4.2-rc' of ↵Greg Kroah-Hartman3-133/+45
git://git.kernel.org/pub/scm/linux/kernel/git/kishon/linux-phy into usb-linus Kishon writes: phy: for 4.2-rc *) Fix PIPE3 PM so that all its users (PCIe, SATA, USB) can idle and resume *) Fix a compiler error in pxa *) Fix pll divider values in berlin-usb phy driver Signed-off-by: Kishon Vijay Abraham I <[email protected]>
2015-07-22xhci: do not report PLC when link is in internal resume stateZhuang Jin Can1-1/+8
Port link change with port in resume state should not be reported to usbcore, as this is an internal state to be handled by xhci driver. Reporting PLC to usbcore may cause usbcore clearing PLC first and port change event irq won't be generated. Cc: <[email protected]> Signed-off-by: Zhuang Jin Can <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22xhci: prevent bus_suspend if SS port resuming in phase 1Zhuang Jin Can3-3/+7
When the link is just waken, it's in Resume state, and driver sets PLS to U0. This refers to Phase 1. Phase 2 refers to when the link has completed the transition from Resume state to U0. With the fix of xhci: report U3 when link is in resume state, it also exposes an issue that usb3 roothub and controller can suspend right after phase 1, and this causes a hard hang in controller. To fix the issue, we need to prevent usb3 bus suspend if any port is resuming in phase 1. [merge separate USB2 and USB3 port resume checking to one -Mathias] Cc: <[email protected]> Signed-off-by: Zhuang Jin Can <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22xhci: report U3 when link is in resume stateZhuang Jin Can1-2/+5
xhci_hub_report_usb3_link_state() returns pls as U0 when the link is in resume state, and this causes usb core to think the link is in U0 while actually it's in resume state. When usb core transfers control request on the link, it fails with TRB error as the link is not ready for transfer. To fix the issue, report U3 when the link is in resume state, thus usb core knows the link it's not ready for transfer. Cc: <[email protected]> Signed-off-by: Zhuang Jin Can <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22xhci: Calculate old endpoints correctly on device resetBrian Campbell1-0/+3
When resetting a device the number of active TTs may need to be corrected by xhci_update_tt_active_eps, but the number of old active endpoints supplied to it was always zero, so the number of TTs and the bandwidth reserved for them was not updated, and could rise unnecessarily. This affected systems using Intel's Patherpoint chipset, which rely on software bandwidth checking. For example, a Lenovo X230 would lose the ability to use ports on the docking station after enough suspend/resume cycles because the bandwidth calculated would rise with every cycle when a suitable device is attached. The correct number of active endpoints is calculated in the same way as in xhci_reserve_bandwidth. Cc: <[email protected]> Signed-off-by: Brian Campbell <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22usb: xhci: Bugfix for NULL pointer deference in xhci_endpoint_init() functionAMAN DEEP1-1/+1
virt_dev->num_cached_rings counts on freed ring and is not updated correctly. In xhci_free_or_cache_endpoint_ring() function, the free ring is added into cache and then num_rings_cache is incremented as below: virt_dev->ring_cache[rings_cached] = virt_dev->eps[ep_index].ring; virt_dev->num_rings_cached++; here, free ring pointer is added to a current index and then index is incremented. So current index always points to empty location in the ring cache. For getting available free ring, current index should be decremented first and then corresponding ring buffer value should be taken from ring cache. But In function xhci_endpoint_init(), the num_rings_cached index is accessed before decrement. virt_dev->eps[ep_index].new_ring = virt_dev->ring_cache[virt_dev->num_rings_cached]; virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; virt_dev->num_rings_cached--; This is bug in manipulating the index of ring cache. And it should be as below: virt_dev->num_rings_cached--; virt_dev->eps[ep_index].new_ring = virt_dev->ring_cache[virt_dev->num_rings_cached]; virt_dev->ring_cache[virt_dev->num_rings_cached] = NULL; Cc: <[email protected]> Signed-off-by: Aman Deep <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22xhci: Workaround to get D3 working in Intel xHCIRajmohan Mani1-3/+37
The xHCI in Intel CherryView / Braswell Platform requires a driver workaround to get xHCI D3 working. Without this workaround, xHCI might not enter D3. Workaround is to configure SSIC PORT as "unused" before D3 entry and "used" after D3 exit. This is done through a vendor specific register (PORT2_SSIC_CONFIG_REG2 at offset 0x883c), in xhci suspend / resume callbacks. Verified xHCI D3 works fine in CherryView / Braswell platform. Signed-off-by: Rajmohan Mani <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22xhci: call BIOS workaround to enable runtime suspend on Intel BraswellMathias Nyman1-0/+17
Intel xhci hw that require XHCI_PME_STUCK quirk have as default disabled xhci from going to D3 state in runtime suspend. Driver needs to verify it can deal with the hw by calling an ACPI _DSM method to get D3 enabled. Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2015-07-22null_blk: fix use-after-free problemMike Krinkin1-9/+9
end_cmd finishes request associated with nullb_cmd struct, so we should save pointer to request_queue in a local variable before calling end_cmd. The problem was causes general protection fault with slab poisoning enabled. Fixes: 8b70f45e2eb2 ("null_blk: restart request processing on completion handler") Tested-by: Akinobu Mita <[email protected]> Signed-off-by: Mike Krinkin <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2015-07-22Merge tag 'fixes-for-v4.2-rc4' of ↵Greg Kroah-Hartman4-8/+14
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-linus Felipe writes: usb: fixes for v4.2-rc4 Only four fixes this time so I'll describe them all. We have an iomen resource leak fix in mv_udc_core. This bug exists since v3.3. Renesas got a fix for how they use dma_map_single() with IOMMU. The new ulpi bus got an ordering fix, so drivers don't try to probe ahead of the bus. And finally, we have a fix for a really old regression with dwc3, one which could only be exposed by a recent patch from Subbaraya. Basically, we were startving the controller of transfer resources. Signed-off-by: Felipe Balbi <[email protected]>
2015-07-22genirq/MSI: Move alloc_msi_entry() from PCI into generic MSI codeJiang Liu3-14/+21
Move alloc_msi_entry() from PCI MSI code into generic MSI code, so it can be reused by other generic MSI drivers. Also introduce free_msi_entry() for completeness. Suggested-by: Stuart Yoder <[email protected]>. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Grant Likely <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22genirq/MSI: Reorginize struct msi_desc to prepare for support of generic MSIJiang Liu1-20/+50
Reorganize struct msi_desc so it could be reused by other MSI drivers. We have the following layout now: struct msi_desc { /* Shared device/bus independent data */ ... union { /* PCI specific data */ struct { ... }; }; }; We need to have anonymous union and a anonymous structure for the PCI fields, otherwise we would have to change all instances using these fields. For non PCI devices we will enforce a proper namespace and a non anonymous structure. [ tglx: Added proper comments to the structure and massaged changelog ] Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22genirq/MSI: Store 'struct device' instead of 'struct pci_dev' in struct msi_descJiang Liu2-8/+10
Store 'struct device *' instead of 'struct pci_dev *' in struct msi_desc, so struct msi_desc can be reused by non PCI based MSI drivers. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22genirq/MSI: Move msi_list from struct pci_dev to struct deviceJiang Liu5-4/+9
Move msi_list from struct pci_dev into struct device, so we can support non-PCI-device based generic MSI interrupts. msi_list is now conditional under CONFIG_GENERIC_MSI_IRQ, which is selected from CONFIG_PCI_MSI, so no functional change for PCI MSI users. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Joe Perches <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Paul Gortmaker <[email protected]> Cc: Luis R. Rodriguez <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22PCI: Use helper functions to access fields in struct msi_descJiang Liu4-17/+18
Use helper functions to access fields in struct msi_desc, so we could easily refine msi_desc later. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Murali Karicheri <[email protected]> Cc: Jingoo Han <[email protected]> Cc: Pratyush Anand <[email protected]> Cc: Michal Simek <[email protected]> Cc: Soeren Brinkmann <[email protected]> Cc: Srikanth Thokala <[email protected]> Cc: Rob Herring <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22sparc/PCI: Use helper functions to access fields in struct msi_descJiang Liu1-1/+1
Use helper functions to access fields in struct msi_desc, so we could easily refine struct msi_desc later. Signed-off-by: Jiang Liu <[email protected]> Acked-by: David S. Miller <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Eric Snowberg <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22PCI: Use for_each_pci_msi_entry() to access MSI device listJiang Liu2-20/+21
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could easily move msi_list from struct pci_dev into struct device later. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Acked-by: Konrad Rzeszutek Wilk <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: David Vrabel <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22x86/PCI: Use for_pci_msi_entry() to access MSI device listJiang Liu1-4/+4
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could easily move msi_list from struct pci_dev into struct device later. Signed-off-by: Jiang Liu <[email protected]> Acked-by: Konrad Rzeszutek Wilk <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Borislav Petkov <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22s390/pci: Use for_pci_msi_entry() to access MSI device listJiang Liu1-3/+3
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could easily move msi_list from struct pci_dev into struct device later. Signed-off-by: Jiang Liu <[email protected]> Acked-by: Sebastian Ott <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Gerald Schaefer <[email protected]> Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22powerpc/PCI: Use for_pci_msi_entry() to access MSI device listJiang Liu8-18/+18
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could easily move msi_list from struct pci_dev into struct device later. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Olof Johansson <[email protected]> Cc: Gavin Shan <[email protected]> Cc: Alexey Kardashevskiy <[email protected]> Cc: David Gibson <[email protected]> Cc: Daniel Axtens <[email protected]> Cc: Wei Yang <[email protected]> Cc: Nishanth Aravamudan <[email protected]> Cc: Alexander Gordeev <[email protected]> Cc: Scott Wood <[email protected]> Cc: Laurentiu Tudor <[email protected]> Cc: Tudor Laurentiu <[email protected]> Cc: Hongtao Jia <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22MIPS/PCI: Use for_pci_msi_entry() to access MSI device listJiang Liu1-1/+1
Use accessor for_each_pci_msi_entry() to access MSI device list, so we could easily move msi_list from struct pci_dev into struct device later. Signed-off-by: Jiang Liu <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Yijing Wang <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Ralf Baechle <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22PCI: Add helper function msi_desc_to_pci_sysdata()Jiang Liu2-0/+15
Add helper function msi_desc_to_pci_sysdata() to retrieve sysdata from an MSI descriptor. To avoid pulling include/linux/pci.h into include/linux/msi.h, msi_desc_to_pci_sysdata() is implemented as a normal function instead of an inline function. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Yijing Wang <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Cc: Tony Luck <[email protected]> Cc: [email protected] Cc: Grant Likely <[email protected]> Cc: Marc Zyngier <[email protected]> Cc: Stuart Yoder <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Alexander Gordeev <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22drivers/irqchip: Replace pr_warning by pr_warnWang Long1-2/+2
Update the last pr_warning callsite in drivers/irqchip. Signed-off-by: Wang Long <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Cc: <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22irqchip: omap-intc: Improve IRQ handlerFelipe Balbi1-30/+5
As it turns out the current IRQ number will *always* be available from SIR register which renders the reads of PENDING registers as plain unnecessary overhead. In order to catch any situation where SIR reads as zero, we're adding a WARN() to turn it into a very verbose error and users actually report it. With this patch average running time of omap_intc_handle_irq() reduced from about 28.5us to 19.8us as measured by the kernel function profiler. Tested with BeagleBoneBlack Rev A5C. Tested-by: Tony Lindgren <[email protected]> Signed-off-by: Felipe Balbi <[email protected]> Cc: Linux ARM Kernel Mailing List <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22Merge tag 'arm64-fixes' of ↵Linus Torvalds2-4/+5
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull ARM64 fixes from Catalin Marinas: - arm64 build fix following the move of the thread_struct to the end of task_struct and the asm offsets becoming too large for the AArch64 ISA - preparatory patch for moving irq_data struct members (applied now to reduce dependency for the next merging window) * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: ARM64/irq: Use access helper irq_data_get_affinity_mask() arm64: switch_to: calculate cpu context pointer using separate register
2015-07-22mm: Fix bugs in region_is_ram()Toshi Kani1-3/+3
region_is_ram() looks up the iomem_resource table to check if a target range is in RAM. However, it always returns with -1 due to invalid range checks. It always breaks the loop at the first entry of the table. Another issue is that it compares p->flags and flags, but it always fails. flags is declared as int, which makes it as a negative value with IORESOURCE_BUSY (0x80000000) set while p->flags is unsigned long. Fix the range check and flags so that region_is_ram() works as advertised. Signed-off-by: Toshi Kani <[email protected]> Reviewed-by: Dan Williams <[email protected]> Cc: Mike Travis <[email protected]> Cc: Luis R. Rodriguez <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Roland Dreier <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22x86/mm: Remove region_is_ram() call from ioremapToshi Kani1-18/+6
__ioremap_caller() calls region_is_ram() to walk through the iomem_resource table to check if a target range is in RAM, which was added to improve the lookup performance over page_is_ram() (commit 906e36c5c717 "x86: use optimized ioresource lookup in ioremap function"). page_is_ram() was no longer used when this change was added, though. __ioremap_caller() then calls walk_system_ram_range(), which had replaced page_is_ram() to improve the lookup performance (commit c81c8a1eeede "x86, ioremap: Speed up check for RAM pages"). Since both checks walk through the same iomem_resource table for the same purpose, there is no need to call both functions. Aside of that walk_system_ram_range() is the only useful check at the moment because region_is_ram() always returns -1 due to an implementation bug. That bug in region_is_ram() cannot be fixed without breaking existing ioremap callers, which rely on the subtle difference of walk_system_ram_range() versus non page aligned ranges. Once these offending callers are fixed we can use region_is_ram() and remove walk_system_ram_range(). [ tglx: Massaged changelog ] Signed-off-by: Toshi Kani <[email protected]> Reviewed-by: Dan Williams <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Mike Travis <[email protected]> Cc: Luis R. Rodriguez <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22x86/mm: Move warning from __ioremap_check_ram() to the call siteToshi Kani1-3/+4
__ioremap_check_ram() has a WARN_ONCE() which is emitted when the given pfn range is not RAM. The warning is bogus in two aspects: - it never triggers since walk_system_ram_range() only calls __ioremap_check_ram() for RAM ranges. - the warning message is wrong as it says: "ioremap on RAM' after it established that the pfn range is not RAM. Move the WARN_ONCE() to __ioremap_caller(), and update the message to include the address range so we get an actual warning when something tries to ioremap system RAM. [ tglx: Massaged changelog ] Signed-off-by: Toshi Kani <[email protected]> Reviewed-by: Dan Williams <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Luis R. Rodriguez <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2015-07-22usb: dwc3: Reset the transfer resource index on SET_INTERFACEJohn Youn1-0/+4
This fixes an issue introduced in commit b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) that made sure we would only use DEPSTARTCFG once per SetConfig. The trick is that we should use one DEPSTARTCFG per SetConfig *OR* SetInterface. SetInterface was completely missed from the original patch. This problem became aparent after commit 76e838c9f776 (usb: dwc3: gadget: return error if command sent to DEPCMD register fails) added checking of the return status of device endpoint commands. 'Set Endpoint Transfer Resource' command was caught failing occasionally. This is because the Transfer Resource Index was not getting reset during a SET_INTERFACE request. Finally, to fix the issue, was we have to do is make sure that our start_config_issued flag gets reset whenever we receive a SetInterface request. To verify the problem (and its fix), all we have to do is run test 9 from testusb with 'testusb -t 9 -s 2048 -a -c 5000'. Tested-by: Huang Rui <[email protected]> Tested-by: Subbaraya Sundeep Bhatta <[email protected]> Fixes: b23c843992b6 (usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPs) Cc: <[email protected]> # v3.2+ Signed-off-by: John Youn <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2015-07-22drm: Stop resetting connector state to unknownDaniel Vetter1-4/+1
It's causing piles of issues since we've stopped forcing full detect cycles in the sysfs interfaces with commit c484f02d0f02fbbfc6decc945a69aae011041a27 Author: Chris Wilson <[email protected]> Date: Fri Mar 6 12:36:42 2015 +0000 drm: Lighten sysfs connector 'status' The original justification for this was that the hpd handlers could use the unknown state as a hint to force a full detection. But current i915 code isn't doing that any more, and no one else really uses reset on resume. So instead just keep the old state around. References: http://article.gmane.org/gmane.comp.freedesktop.xorg.drivers.intel/62584 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100641 Cc: Rui Matos <[email protected]> Cc: Julien Wajsberg <[email protected]> Cc: [email protected] Cc: Lennart Poettering <[email protected]> Cc: [email protected] Acked-by: Rob Clark <[email protected]> Tested-by: Rui Tiago Cação Matos <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
2015-07-22ARM64/irq: Use access helper irq_data_get_affinity_mask()Jiang Liu1-2/+2
This is a preparatory patch for moving irq_data struct members. Signed-off-by: Jiang Liu <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Cc: [email protected] Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Catalin Marinas <[email protected]>