All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: David Kershner <david.kershner@unisys.com>
To: gregkh@linuxfoundation.org
Cc: Jes.Sorensen@redhat.com, driverdev-devel@linuxdriverproject.org,
	sParMaintainer@unisys.com, Benjamin.Romer@unisys.com,
	David Kershner <david.kershner@unisys.com>
Subject: [PATCH v2 3/3] staging: unisys: Don't hold device responses until driver loads
Date: Fri, 12 Jun 2015 16:46:08 -0400	[thread overview]
Message-ID: <1434141968-4133-4-git-send-email-david.kershner@unisys.com> (raw)
In-Reply-To: <1434141968-4133-1-git-send-email-david.kershner@unisys.com>

Currently if a driver is not loaded for a device, we will not
respond to the device create until it is done. This causes
s-Par to not mark the partition running if the driver for the
device is not loaded. Since there are several devices that
could be assigned to a guest that don't have an actual
driver this will cause us to never go running.

If the device driver is loaded, we WILL continue to only
respond to the device PAUSE message when the device driver
has responded that it is done with the device.

Signed-off-by: David Kershner <david.kershner@unisys.com>
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 28 +++++++------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c
index dcce1f0..b22af16 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -70,7 +70,6 @@ static const struct attribute_group *visorbus_bus_groups[] = {
 	NULL,
 };
 
-
 /** This describes the TYPE of bus.
  *  (Don't confuse this with an INSTANCE of the bus.)
  */
@@ -745,19 +744,6 @@ visordriver_probe_device(struct device *xdev)
 away:
 	if (rc != 0)
 		put_device(&dev->device);
-	/*  We could get here more than once if the child driver module is
-	 *  unloaded and re-loaded while devices are present.  That's why we
-	 *  need a flag to be sure that we only respond to the device_create
-	 *  once.  We cannot respond to the device_create prior to here,
-	 *  because until we call drv->probe() above, the channel has not been
-	 *  initialized.
-	 */
-	if (!dev->responded_to_device_create) {
-
-		dev->responded_to_device_create = true;
-		if (chipset_responders.device_create)
-			(*chipset_responders.device_create)(dev, rc);
-	}
 	return rc;
 }
 
@@ -1306,15 +1292,15 @@ chipset_device_create(struct visor_device *dev_info)
 			 POSTCODE_SEVERITY_INFO);
 
 	rc = create_visor_device(dev_info);
-	if (rc < 0) {
+	if (chipset_responders.device_create)
+		chipset_responders.device_create(dev_info, rc);
+
+	if (rc < 0)
 		POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no,
 				 POSTCODE_SEVERITY_ERR);
-		if (chipset_responders.device_create)
-			(*chipset_responders.device_create)(dev_info, rc);
-	}
-
-	POSTCODE_LINUX_4(DEVICE_CREATE_SUCCESS_PC, dev_no, bus_no,
-			 POSTCODE_SEVERITY_INFO);
+	else
+		POSTCODE_LINUX_4(DEVICE_CREATE_SUCCESS_PC, dev_no, bus_no,
+				 POSTCODE_SEVERITY_INFO);
 }
 
 static void
-- 
1.9.1

      parent reply	other threads:[~2015-06-12 20:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 20:46 [PATCH v2 0/3] staging: unisys: visorbus fixes David Kershner
2015-06-12 20:46 ` [PATCH v2 1/3] staging: unisys: Move phys_info to iochannel.h David Kershner
2015-06-12 20:46 ` [PATCH v2 2/3] staging: unisys: convert pack pragma to __packed David Kershner
2015-06-13  0:07   ` Greg KH
2015-06-19 12:55   ` Dan Carpenter
2015-06-19 15:02     ` Kershner, David A
2015-06-19 15:08       ` Jes Sorensen
2015-06-19 19:11       ` Dan Carpenter
2015-06-12 20:46 ` David Kershner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434141968-4133-4-git-send-email-david.kershner@unisys.com \
    --to=david.kershner@unisys.com \
    --cc=Benjamin.Romer@unisys.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=sParMaintainer@unisys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.