Commit Graph

433 Commits (ebe8190659244ec21b5f16950cf7b156f5b7eb01)

Author SHA1 Message Date
Konrad Rzeszutek Wilk dfc07b13dc xen/blkback: Move it from drivers/xen to drivers/block
.. and modify the Makefile and Kconfig files appropriately.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-18 14:30:26 -04:00
Konrad Rzeszutek Wilk d2436eda2e block, xen/blkback: remove blk_[get|put]_queue calls.
They were used to check if the queue does not have QUEUE_FLAG_DEAD
set. That is not necessary anymore as the 'submit_io' call
ends up doing that for us.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-18 14:26:17 -04:00
Konrad Rzeszutek Wilk 6fd17b5643 xen/blkback: Get the 'requeust_queue' properly.
After the commit 0faa8cca88
("    xen/blkback: remove per-queue plugging") we forgot
to retrieve the 'struct request_queue' from the block device.

This puts the functionality back in and fixes a NULL pointer
bug.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-18 12:06:14 -04:00
Konrad Rzeszutek Wilk e93504933e xen/blkback: Move the check for misaligned I/O once more.
The commit 976222e05e

    xen/blkback: Move the check for misaligned I/O higher.

moved it a bit to high. The preq->vbdev was not set, so the
check for misaligned I/O would cause a NULL pointer derefence.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-18 11:34:55 -04:00
Konrad Rzeszutek Wilk 9f3aedf573 xen/blkback: Change fast_flush_area to xen_blkbk_unmap, and tweak xen_blk_map_seg.
The previous name ('fast_flush_area') had nothing to do with what it
does right now. Changing the names so that the code dealing with
mapping pages in and out of the guest is called xen_blkbk_[map|unmap].

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-15 11:50:34 -04:00
Konrad Rzeszutek Wilk 976222e05e xen/blkback: Move the check for misaligned I/O higher.
We move it up higher to be in same loop that actually computes
the sector number.

This way, all of the code that deals with verifying that the
request is correct is all done before we do any of the
page mapping, I/O submission, etc.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-15 11:38:29 -04:00
Konrad Rzeszutek Wilk 1a95fe6e42 xen/blkback: Shuffle code around (vbd_translate moved higher).
We take out the chunk of code dealing with mapping to the guest
of pages into the xen_blk_map_buf code. And we also move the
vbd_translate to be done much earlier.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-15 11:35:13 -04:00
Konrad Rzeszutek Wilk b0aef17924 xen/blkback: Cleanup move the code a bit around.
Moving it so that the code that 'fast_flush_area' code is
close to the code that deals with it so that the reader
won't lose focus.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-15 10:59:06 -04:00
Konrad Rzeszutek Wilk 7708992616 xen/blkback: Seperate the bio allocation and the bio submission.
We seperate the bio allocation (bio_alloc) from the bio submission so
that the error paths are much easier, and also so that the bio
submission can be done in one tight loop. It also makes the
plug/unplug calls much much easier.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-15 10:54:42 -04:00
Konrad Rzeszutek Wilk 0faa8cca88 xen/blkback: remove per-queue plugging
commit 7eaceaccab ("block: remove per-queue plugging")
added two new interfaces to plug and unplug: blk_start_plug
and blk_finish_plug. Lets use those.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:35 -04:00
Konrad Rzeszutek Wilk 2e9977c21f xen/blkback: Fix checkpatch warnings in blkback.c
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:34 -04:00
Konrad Rzeszutek Wilk d6091b217d xen/blkback: Fix checkpatch warnings of xenbus.c
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:33 -04:00
Konrad Rzeszutek Wilk e5f4b3c498 xen/blkback: Fix interface.c checkpatch warnings .. except
+               sring_x86_64 = (struct blkif_x86_64_sring *)blkif->blk_ring_area->addr;

WARNING: line over 80 characters
+               BACK_RING_INIT(&blkif->blk_rings.x86_64, sring_x86_64, PAGE_SIZE);

as breaking them up really does not help that much.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:32 -04:00
Konrad Rzeszutek Wilk 3c64b58cd6 xen/blkback: Fix checkpatch warnings in vbd.c
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:30 -04:00
Konrad Rzeszutek Wilk 5489377ce4 xen/blkback: blkif->struct blkif_st
checkpatch.pl suggested that we don't use the typdef in common.h
and this triggered this avalanche of patches.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:29 -04:00
Konrad Rzeszutek Wilk a1397fa309 xen/blkback: Add some comments.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:28 -04:00
Tom Goetz 314146e515 xen/blkback: Fix the WRITE_BARRIER
The WRITE_BARRIER was missing the REQ_WRITE option. This
was causing the blktap to die.

Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:27 -04:00
Konrad Rzeszutek Wilk a742b02c75 xen/blkback: Use kzalloc's, and GFP_KERNEL for data structures.
The patch titled:"xen/blkback: Use 'vzalloc' for page arrays and pre-allocate pages."
allocates the structures and its member variables using the 'vzalloc'.

Daniel Stodden pointed out that vzalloc is good when we use
big number of pages - while these are at the max two pages.

We can do this using kzalloc. Also the GFP_HIGHMEM does not
work properly with Xen, so take that out.

We will have to revisit this when a "get_empty_pages_and_pagevec"
type API shows up to leverage that.

BugLink: http://mid.gmane.org/1299898639.11681.227.camel@agari.van.xensource.com

CC: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:25 -04:00
Konrad Rzeszutek Wilk 5dc03639cc xen/blkback: Utilize the M2P override mechanism for GNTMAP_host_map
Instead of doing copy grants lets do mapping grants using
the M2P(and P2M) override mechanism.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Conflicts:

	drivers/xen/blkback/blkback.c
2011-04-14 18:26:24 -04:00
Konrad Rzeszutek Wilk 464fb419e1 xen/blkback: Use 'vzalloc' for page arrays and pre-allocate pages.
Previously we would allocate the array for page using 'kmalloc' which
we can as easily do with 'vzalloc'. The pre-allocation of pages
was done a bit differently in the past - it used to be that
the balloon driver would export "alloc_empty_pages_and_pagevec"
which would have in one function created an array, allocated
the pages, balloned the pages out (so the memory behind those
pages would be non-present), and provide us those pages.

This was OK as those pages were shared between other guest and
the only thing we needed was to "swizzel" the MFN of those pages
to point to the other guest MFN. We can still "swizzel" the MFNs
using the M2P (and P2M) override API calls, but for the sake of
simplicity we are dropping the balloon API calls. We can return
to those later on.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:23 -04:00
Konrad Rzeszutek Wilk c35950bfa9 xen/blkback: Union the blkif_request request specific fields
Following in the steps of patch:
"xen: Union the blkif_request request specific fields" this patch
changes the blkback. Per the original patch:

"Prepare for extending the block device ring to allow request
specific fields, by moving the request specific fields for
reads, writes and barrier requests to a union member."

Cc: Owen Smith <owen.smith@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:22 -04:00
Konrad Rzeszutek Wilk e8e28871ed xen/blkback: Move global/static variables into struct xen_blkbk.
Bundle the lot of discrete variables into a single structure.
This is based on what was done in the xen-netback driver:
xen: netback: Move global/static variables into struct xen_netbk.
(094944631cc5a9d6e623302c987f78117c0bf7ac)

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:20 -04:00
Jan Beulich efe08a3eec xen/blkback: simplify address translations
Cherry-pick and modified from 69d64727c42eecd47fdf82c15a54474d21a4012a
("blkback/blktap2: simplify address translations"):

"There are quite a number of places where e.g. page->va->page
translations happen.

Besides yielding smaller code (source and binary), a second goal is to
make it easier to determine where virtual addresses of pages allocated
through alloc_empty_pages_and_pagevec() are really used (in turn in
order to determine whether using highmem pages would be possible
there)."

The second goal is not the purpose of this patch - it is just to
make it easier to read the code.

linux-2.6-pvops:
 * Stripped drivers/xen/gntdev/*
 * Stripped drivers/xen/netback/*

[v2: Stripped blktap off]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-04-14 18:26:19 -04:00
Konrad Rzeszutek Wilk bc0c081b0e xen/blkback: Update to use blkdev_get_by_dev instead of open_by_devnum.
The API for opening a block device has changed since 2.6.32. The
correct function to open a device is blkdev_get_by_dev.
2011-04-14 18:26:18 -04:00
Konrad Rzeszutek Wilk 248e9f7539 xen/blkback: Replace WRITE_BARRIER with (REQ_FLUSH | REQ_FUA)
TODO: Double check xen-blkfront.c
2011-04-14 18:26:17 -04:00
Keir Fraser 313d7b003c blkback: Fix CVE-2010-3699
A guest can cause the backend driver to leak a kernel thread. Such
leaked threads hold references to the device, whichmakes the device
impossible to tear down. If shut down, the guest remains a zombie
domain, the xenwatch process hangs, and most xm commands will stop
working.

This patch tries to do the following for blkback:
    - identify/extract idempotent teardown operations,
    - add/move the invocation of said teardown operation
      right before we're about to allocate new resources in the
      Connected states.

[ linux-2.6.18-xen.hg 59f097ef181b ]

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:15 -04:00
K. Y. Srinivasan a81135d90b xen/blkback: Print additional information when a vbd is resized.
Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:14 -04:00
Chris Lalancette cbf462908c xen/blkback: Flush blkback data when connecting.
First cut at flushing blkback data when first connecting
blkback.  This should avoid the pygrub issues we are experiencing
in (RedHat bugzilla) 466681.

[ 2.6.18-xen.hg commit 63b4d7f56688 ]

Signed-off-by: Chris Lalancette <clalance@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:13 -04:00
Jeremy Fitzhardinge 98e036a356 xen/blkback: add accessor for xenbus backend device
Since backend_info is hidden away now.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:12 -04:00
K. Y. Srinivasan 2ccbfe26c1 xen/blkback: Propagate changed size of VBDs
Support dynamic resizing of virtual block devices. This patch supports
both file backed block devices as well as physical devices that can be
dynamically resized on the host side.

Signed-off-by: K. Y. Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:10 -04:00
Jeremy Fitzhardinge 5cf6e4f6f6 xen/blkback: use drv_get/set_drvdata rather than directly accessing driver_data.
Direct driver_data access is obsolete and will disappear.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:09 -04:00
Ian Campbell e7579a99b5 xen: rename blkbk module xen-blkback.
blkbk is rather generic for a modular distro style kernel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:08 -04:00
Konrad Rzeszutek Wilk 8770b2683f Fix compile warnings: ignoring return value of 'xenbus_register_backend' ..
We neglect to check the return value of xenbus_register_backend
and take actions when that fails. This patch fixes that and adds
code to deal with those type of failures.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:07 -04:00
Jeremy Fitzhardinge afd91d07ff xen/blkback: little cleanups
Remove unused local prototype; group headers.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:06 -04:00
Jeremy Fitzhardinge 0660c7dbf2 xen/blkback: remove spurious debug output noise
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:04 -04:00
Jeremy Fitzhardinge 05d43865dd xen/blkback: deal with hardsect_size to logical_block_size rename
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
2011-04-14 18:26:03 -04:00
Keir Fraser 8270b45bc8 blkback: Fix potential resource leak. 2011-04-14 18:26:00 -04:00
Jeremy Fitzhardinge dd3672424c xen/blkback: don't include xen/evtchn.h
It's a user-mode header for users of /dev/evtchn

Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org>
2011-04-14 18:25:59 -04:00
Jeremy Fitzhardinge 8812293323 xen-blkback-porting 2011-04-14 18:25:58 -04:00
Konrad Rzeszutek Wilk 4d05a28db5 xen: add blkback support
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Conflicts:

	drivers/xen/Makefile
2011-04-14 18:25:47 -04:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Thomas Gleixner e240ae4aad xen: Use new irq_move functions
These functions take irq_data as an argument and avoid a redundant
lookup in the sparse irq case.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-29 10:01:05 -04:00
Thomas Gleixner 3b3af76166 xen: Convert genirq namespace
Converted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-29 10:01:04 -04:00
Dan Carpenter a93e20a830 xen-gntdev: unlock on error path in gntdev_mmap()
We should unlock here and also decrement the number of &map->users.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-24 10:32:45 -04:00
Dan Carpenter 12f0258d5b xen-gntdev: return -EFAULT on copy_to_user failure
copy_to_user() returns the amount of data remaining to be copied.  We
want to return a negative error code here.  The upper layers just
call WARN_ON() if we return non-zero so this doesn't change the
behavior.  But returning -EFAULT is still cleaner.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-24 10:32:44 -04:00
Linus Torvalds 804f185369 Merge branch 'stable/xen.pm.bug-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/xen.pm.bug-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: use freeze/restore/thaw PM events for suspend/resume/chkpt
  xen: xenbus PM events support
2011-03-17 18:37:42 -07:00
Linus Torvalds 5a39837f76 Merge branches 'stable/irq.fairness' and 'stable/irq.ween_of_nr_irqs' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/irq.fairness' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: events: Remove redundant clear of l2i at end of round-robin loop
  xen: events: Make round-robin scan fairer by snapshotting each l2 word once only
  xen: events: Clean up round-robin evtchn scan.
  xen: events: Make last processed event channel a per-cpu variable.
  xen: events: Process event channels notifications in round-robin order.

* 'stable/irq.ween_of_nr_irqs' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: events: Fix compile error if CONFIG_SMP is not defined.
  xen: events: correct locking in xen_irq_from_pirq
  xen: events: propagate irq allocation failure instead of panicking
  xen: events: do not workaround too-small nr_irqs
  xen: events: remove use of nr_irqs as upper bound on number of pirqs
  xen: events: dynamically allocate irq info structures
  xen: events: maintain a list of Xen interrupts
  xen: events: push setup of irq<->{evtchn,ipi,virq,pirq} maps into irq_info init functions
  xen: events: turn irq_info constructors into initialiser functions
  xen: events: use per-cpu variable for cpu_evtchn_mask
  xen: events: refactor GSI pirq bindings functions
  xen: events: rename restore_cpu_pirqs -> restore_pirqs
  xen: events: remove unused public functions
  xen: events: fix xen_map_pirq_gsi error return
  xen: events: simplify comment
  xen: events: separate two unrelated halves of if condition

Fix up trivial conflicts in drivers/xen/events.c
2011-03-17 18:27:49 -07:00
Linus Torvalds 514af9f790 Merge branches 'stable/hvc-console', 'stable/gntalloc.v6' and 'stable/balloon' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
* 'stable/hvc-console' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/hvc: Disable probe_irq_on/off from poking the hvc-console IRQ line.

* 'stable/gntalloc.v6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: gntdev: fix build warning
  xen/p2m/m2p/gnttab: do not add failed grant maps to m2p override
  xen-gntdev: Add cast to pointer
  xen-gntdev: Fix incorrect use of zero handle
  xen: change xen/[gntdev/gntalloc] to default m
  xen-gntdev: prevent using UNMAP_NOTIFY_CLEAR_BYTE on read-only mappings
  xen-gntdev: Avoid double-mapping memory
  xen-gntdev: Avoid unmapping ranges twice
  xen-gntdev: Use map->vma for checking map validity
  xen-gntdev: Fix unmap notify on PV domains
  xen-gntdev: Fix memory leak when mmap fails
  xen/gntalloc,gntdev: Add unmap notify ioctl
  xen-gntalloc: Userspace grant allocation driver
  xen-gntdev: Support mapping in HVM domains
  xen-gntdev: Add reference counting to maps
  xen-gntdev: Use find_vma rather than iterating our vma list manually
  xen-gntdev: Change page limit to be global instead of per-open

* 'stable/balloon' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (24 commits)
  xen-gntdev: Use ballooned pages for grant mappings
  xen-balloon: Add interface to retrieve ballooned pages
  xen-balloon: Move core balloon functionality out of module
  xen/balloon: Remove pr_info's and don't alter retry_count
  xen/balloon: Protect against CPU exhaust by event/x process
  xen/balloon: Migration from mod_timer() to schedule_delayed_work()
  xen/balloon: Removal of driver_pages
2011-03-17 18:16:36 -07:00
Linus Torvalds 7a6362800c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1480 commits)
  bonding: enable netpoll without checking link status
  xfrm: Refcount destination entry on xfrm_lookup
  net: introduce rx_handler results and logic around that
  bonding: get rid of IFF_SLAVE_INACTIVE netdev->priv_flag
  bonding: wrap slave state work
  net: get rid of multiple bond-related netdevice->priv_flags
  bonding: register slave pointer for rx_handler
  be2net: Bump up the version number
  be2net: Copyright notice change. Update to Emulex instead of ServerEngines
  e1000e: fix kconfig for crc32 dependency
  netfilter ebtables: fix xt_AUDIT to work with ebtables
  xen network backend driver
  bonding: Improve syslog message at device creation time
  bonding: Call netif_carrier_off after register_netdevice
  bonding: Incorrect TX queue offset
  net_sched: fix ip_tos2prio
  xfrm: fix __xfrm_route_forward()
  be2net: Fix UDP packet detected status in RX compl
  Phonet: fix aligned-mode pipe socket buffer header reserve
  netxen: support for GbE port settings
  ...

Fix up conflicts in drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
with the staging updates.
2011-03-16 16:29:25 -07:00
Shriram Rajagopalan b3e96c0c75 xen: use freeze/restore/thaw PM events for suspend/resume/chkpt
Use PM_FREEZE, PM_THAW and PM_RESTORE power events for
suspend/resume/checkpoint functionality, instead of PM_SUSPEND
and PM_RESUME. Use of these pm events fixes the Xen Guest hangup
when taking checkpoints. When a suspend event is cancelled
(while taking checkpoints once/continuously), we use PM_THAW
instead of PM_RESUME. PM_RESTORE is used when suspend is not
cancelled. See Documentation/power/devices.txt and linux/pm.h
for more info about freeze, thaw and restore. The sequence of
pm events in a suspend-resume scenario is shown below.

        dpm_suspend_start(PMSG_FREEZE);

                dpm_suspend_noirq(PMSG_FREEZE);

                       sysdev_suspend(PMSG_FREEZE);
                       cancelled = suspend_hypercall()
                       sysdev_resume();

               dpm_resume_noirq(cancelled ? PMSG_THAW : PMSG_RESTORE);

       dpm_resume_end(cancelled ? PMSG_THAW : PMSG_RESTORE);

Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2011-03-16 13:42:56 -04:00