summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/visorchipset.c
AgeCommit message (Collapse)Author
2015-09-08Merge tag 'libnvdimm-for-4.3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "This update has successfully completed a 0day-kbuild run and has appeared in a linux-next release. The changes outside of the typical drivers/nvdimm/ and drivers/acpi/nfit.[ch] paths are related to the removal of IORESOURCE_CACHEABLE, the introduction of memremap(), and the introduction of ZONE_DEVICE + devm_memremap_pages(). Summary: - Introduce ZONE_DEVICE and devm_memremap_pages() as a generic mechanism for adding device-driver-discovered memory regions to the kernel's direct map. This facility is used by the pmem driver to enable pfn_to_page() operations on the page frames returned by DAX ('direct_access' in 'struct block_device_operations'). For now, the 'memmap' allocation for these "device" pages comes from "System RAM". Support for allocating the memmap from device memory will arrive in a later kernel. - Introduce memremap() to replace usages of ioremap_cache() and ioremap_wt(). memremap() drops the __iomem annotation for these mappings to memory that do not have i/o side effects. The replacement of ioremap_cache() with memremap() is limited to the pmem driver to ease merging the api change in v4.3. Completion of the conversion is targeted for v4.4. - Similar to the usage of memcpy_to_pmem() + wmb_pmem() in the pmem driver, update the VFS DAX implementation and PMEM api to provide persistence guarantees for kernel operations on a DAX mapping. - Convert the ACPI NFIT 'BLK' driver to map the block apertures as cacheable to improve performance. - Miscellaneous updates and fixes to libnvdimm including support for issuing "address range scrub" commands, clarifying the optimal 'sector size' of pmem devices, a clarification of the usage of the ACPI '_STA' (status) property for DIMM devices, and other minor fixes" * tag 'libnvdimm-for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (34 commits) libnvdimm, pmem: direct map legacy pmem by default libnvdimm, pmem: 'struct page' for pmem libnvdimm, pfn: 'struct page' provider infrastructure x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB add devm_memremap_pages mm: ZONE_DEVICE for "device memory" mm: move __phys_to_pfn and __pfn_to_phys to asm/generic/memory_model.h dax: drop size parameter to ->direct_access() nd_blk: change aperture mapping from WC to WB nvdimm: change to use generic kvfree() pmem, dax: have direct_access use __pmem annotation dax: update I/O path to do proper PMEM flushing pmem: add copy_from_iter_pmem() and clear_pmem() pmem, x86: clean up conditional pmem includes pmem: remove layer when calling arch_has_wmb_pmem() pmem, x86: move x86 PMEM API to new pmem.h header libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option pmem: switch to devm_ allocations devres: add devm_memremap libnvdimm, btt: write and validate parent_uuid ...
2015-08-14visorbus: switch from ioremap_cache to memremapDan Williams
In preparation for deprecating ioremap_cache() convert its usage in visorbus to memremap. Cc: Benjamin Romer <benjamin.romer@unisys.com> Cc: David Kershner <david.kershner@unisys.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2015-07-16staging: unisys: fix copyright statementsBenjamin Romer
The copyright statements in the drivers need to be correct and consistent; this patch fixes the year for all of them, and makes the statement text cover just the GPL V2. Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14staging: unisys: Lock visorchannels associated with devicesDavid Kershner
A visorchannel associated with a device should have its writing to the channel protected by a lock. Fixes: b32c4997c ('staging: unisys: Move channel creation up the stack') Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14staging: unisys: Allow visorbus to autoloadDavid Kershner
We inadvertently remove the MODULE_DEVICE_TABLE line for visorbus, this patch adds it back in. Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Fixes: d5b3f1dccee4 ('staging: unisys: move timskmod.h functionality') Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14staging: unisys: respond to msgs post device_createTim Sell
Fix problem that prevents us from responding to any device message after device_create. By neglecting to NULL out pending_msg_hdr after the device_create response, we were effectively preventing any subsequent messages to the device from working, because device_epilog() will correctly bail out early if it sees that pending_msg_hdr is still set non-NULL, as that is an indicator to mean that an unanswered message is still outstanding. This problem was discovered as part of testing IOVM service partition recovery, because device_epilog() was in fact bailing out when it was called from my_device_changestate(), which of course prevented us from transitioning the device to the paused state. However, the incorrect behavior would occur for ANY subsequent command directed at the device, not just for changestate. Signed-off-by: Tim Sell <Timothy.Sell@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: unisys: fix "missing a blank line" coding styleAlessandro Parini
fix coding style issue "Missing a blank line after declarations" detected by checkpatch.pl in visorchipset.c Signed-off-by: Alessandro Parini <alessandro.parini@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13staging: unisys: fix braces coding styleAlessandro Parini
fix coding style issue "braces {} are not necessary for single statement blocks" detected by checkpatch.pl in visorchipset.c Signed-off-by: Alessandro Parini <alessandro.parini@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Add the bus device to the visor device list.David Kershner
When the bus device was created the list_all variables were not being initialized. When the CONTROLVM_BUS_CONFIGURE message was being sent, it was failing to find the bus and produced a panic. Initialize the bus_info->list_all variable by doing a INIT_LIST_HEAD. Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Fix clean up pathDon Zickus
When unloading a module, we need to cleanup the platform registration. However, unregistering the platform uncovered a couple of quirks, namely a missing device_release function. Fix things up so module unload works and allows us to reload the module. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Remove unneeded fields in diagchannel.hDavid Kershner
Diagchannel.h is used primarily for the diagnostics channel. The diagnostics channel is not being used by linux guests currently, so the majority of the file is not needed. What is left is what is needed to perform postcode vmcalls. Those postcodes will eventually end up in the diag channel. Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Convert device creation to use visor_deviceDon Zickus
This patch removes the legacy dev_info struct and instead creates and passes around a traditional struct device. This allows us to remove a lot of the various look up code and removes the doubt if the struct exists or not. Half of the churn is just the conversion of visorchipset_device_info to visor_device. Various cleanups include re-arranging the failure paths to make more sense. Pay attention to the create_visor_device function. This had a lot of churn to simplify everything. Lots of functions disappeared because they are not needed any more. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Convert bus creation to use visor_deviceDon Zickus
This patch removes the legacy bus_info struct and instead creates and passes around a traditional struct device. This allows us to remove a lot of the various look up code and removes the doubt if the struct exists or not. Half of the churn is just the conversion of visorchipset_bus_info to visor_device. Various cleanups include re-arranging the failure paths to make more sense. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Do not use 0 as the default bus root device numberDon Zickus
I used 0 as the device id for the bus root, neglecting the fact that device 0 is a valid id in Unisys's configuration. Modify this to use UINT_MAX instead as a unique number. As fallout from this change it was noticed the bus_no and dev_no was not defined the same way consistently. Fix visorbus.h to use u32 there. Fix the resulting printk warning too. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08staging: unisys: Remove server flagsDon Zickus
The bus driver doesn't work in server mode, just remove the left over pieces. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-02staging: unisys: Convert pending_msg_hdr to a pointerDon Zickus
In order for bus/dev_info structs to become public structs, one element, pending_msg_hdr, needs to become opaque. This is to keep all the internals of the controlvm struct private to the bus layer. So a simple conversion of embedding the pending_msg_hdr struct into a pointer is done. The rest of the patch is the fallout. The rules are modified slightly. Instead of relying on the 'id' to be CONTROLVM_INVALID to indicate invalid, just use the pointer set to NULL. In addition, because bus/dev_info can be NULL and we still need to send a response, pass pending_msg_hdr to all 'responders' instead of bus/ That change causes some fallout in the success case. Instead of setting state bits and clearing info in the responders, do all that magic in the responder wrappers. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-02staging: unisys: Move channel creation up the stackDon Zickus
Instead of creating a channel struct to temporarily hold the channel info and passing it through multiple functions until the device is created, just create the channel from the start. This allows us to remove the channel_info struct. I noticed 'chan_info.addr_type' was not being used, so I just deleted it. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Convert device functions to pass dev_info pointer aroundDon Zickus
Most device functions pass bus_no and dev_no around and then do a lookup inside each function to find the dev_info struct. Instead just pass the pointer. This prepares us for a later conversion to using visor device. No real technical changes. Just function header changes and little cleanups as a result. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Convert bus functions to pass bus_info pointer aroundDon Zickus
Most bus functions pass bus_no around and then do a lookup inside each function to find the bus_info struct. Instead just pass the pointer. This prepares us for a later conversion to using visor_device. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Remove unused intrDon Zickus
The conversion to visor_device caused some compile issues.The main problem was the new fields in 'struct visor_device' were not public. Remove one that wasn't being used for now. struct irq_info intr Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Add visor device find routineDon Zickus
If we are going to remove the bus_info structs than we need a way to find the devices when the *_create/destroy cmds are sent over the vmchannel. This function crudely impements what pci has. It takes a bus_no and dev_no and finds the matching 'struct visor_device'. This function can/should be optimzed later once we get our heads wrapped around its needs. For now, I am using dev_no=0 to mean the visorbus itself. The function is limited to chipset.c only because it is only needed to do the lookups upon receiving a vmchannel command. Future patches will make sure the resulting 'struct visor_device' is used every where else. Also allow visorbus_type to be more visible for use. Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: remove remaining utility headersDavid Kershner
remove uisqueue.h, uisthread.h, and uisutils.h replace HOSTADDRESS with u64 remove "uisutils.h" from header list in visorchipset.c Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Remove unused livedump_infoJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: visorchipset_init(): Simplify initial checksJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: Remove unused visorchipset_save_message()Jes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24staging: unisys: visorchipset_file_{init, cleanup}(): mark staticJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchipset: Remove unused cache allocatorJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: Remove wrapper around parser_init_guts()Jes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: parser_init_guts(): standard_payload_header is always falseJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: parser: Remove unused functions and mark others staticJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchipset: Declare parser_init_byte_stream() staticJes Sorensen
In addition remove unused parser_init() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchannel: Make visorchannel_create take a gfp_tJes Sorensen
This allows the caller to specify an appropriate GFP flag instead of hardcoding the lowest common denominator. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: remove timskmod.h and procobjecttree.hErik Arfvidson
This patch move the needed linux include files from timskmod.h to the files that calls those include. Also procobjecttree.h is removed since it is dead code. Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: move timskmod.h functionalityErik Arfvidson
This patch removes all timksmod.h pound defines. It also removes visorkmodutils.c since it no longer has any use by itself. Since visorkmodutils.c is no longer needed the module_init for visorchipset.c is modified to call visorutil_spar_detect directly instead of the extern variable in timksmod.h. Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: add acpi pnp driverPrarit Bhargava
According to Unisys, another OS detects the PNP0A07 as the auto load device. We can also do this in the linux kernel by simply converting the driver over to the ACPI driver model. Notes: This changes the usage of __init and it had to be removed from some functions to avoid a !__init function calling an __init function. Additionally I also cleaned up the headers in visorchipset.c since I was adding a header file. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: remove BOOL,TRUE,FALSE definitionsPrarit Bhargava
These shouldn't be defined in the code and can be replaced with the standard bool, true, and false usage that the kernel uses. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: get rid of serialloopbacktestDavid Kershner
serialloopbacktest is no longer supported. Get rid of it. Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: remove server crust from visorchipset.David Kershner
The visorchipset driver originally serviced both servers and clients. This implementation is client only so remove some more server side implementation. Signed-off-by: David Kershner <david.kershner@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: remove typedef GUEST_PHYSICAL_ADDRESS to u64Erik Arfvidson
This patch removes typedef GUEST_PHYSICAL_ADDRESS to u64 Signed-off-by: Erik Arfvidson <erik.arfvidson@unisys.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchipset.c: No need to include memregion.h anymoreJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchipset: Use ioremap direction rather than heavy ↵Jes Sorensen
visor_memregion Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: visorchipset: parser_init_guts(): Localize memregion usageJes Sorensen
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: cleanup visorbus_private.hPrarit Bhargava
visorbus_private.h contains code that is called from visorbus into the visorchipset code. Now that the visorchipset code has been brought into the visorbus directory, many of the declarations are not necessary and can be cleaned up. TODO: PARSER_WHICH_STRING enum only has one member used (PARSERSTRING_NAME). TODO: crash_obj_type appears to be unnecessary in the overall scheme of code. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08staging: unisys: move visorchipset files to visorbusPrarit Bhargava
Move visorchipset_main.c and visorchipset.h to visorbus/visorchipset.c and visorbus/visorbus_private.h. This leaves an empty visorchipset directory which can also be destroyed. As a result of this patch the visorchipset init code now calls the visorbus_init() directly. Similarily the visorchipset exit code now cleans up by calling visorbus_exit(). No other functional changes were made. Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>