All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>
To: JBottomley@Parallels.com, linux-scsi@vger.kernel.org
Cc: Mahesh.Rajashekhara@pmcs.com, Murthy.Bhat@pmcs.com,
	Santosh.Akula@pmcs.com, Gana.Sridaran@pmcs.com,
	aacraid@pmc-sierra.com, Rich.Bono@pmcs.com,
	RaghavaAditya.Renukunta@pmcs.com
Subject: [PATCH 09/10] aacraid: Fix character device re-initialization
Date: Tue, 1 Dec 2015 04:39:47 -0800	[thread overview]
Message-ID: <1448973589-9216-10-git-send-email-RaghavaAditya.Renukunta@pmcs.com> (raw)
In-Reply-To: <1448973589-9216-1-git-send-email-RaghavaAditya.Renukunta@pmcs.com>

From: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>

During EEH PCI hotplug activity kernel unloads and loads the driver,
causing character device to be unregistered(aac_remove_one).When the
driver is loaded back using aac_probe_one the character device needs
to be registered again for the AIF management tools to work.

Fixed by adding code to register character device in aac_probe_one if
it is unregistered in aac_remove_one.

Signed-off-by: Raghava Aditya Renukunta <raghavaaditya.renukunta@pmcs.com>
---
 drivers/scsi/aacraid/linit.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 2094842..7142578 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -1123,6 +1123,13 @@ static void __aac_shutdown(struct aac_dev * aac)
 	else if (aac->max_msix > 1)
 		pci_disable_msix(aac->pdev);
 }
+static void aac_init_char(void)
+{
+	aac_cfg_major = register_chrdev(0, "aac", &aac_cfg_fops);
+	if (aac_cfg_major < 0) {
+		pr_err("aacraid: unable to register \"aac\" device.\n");
+	}
+}
 
 static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
@@ -1185,6 +1192,9 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	shost->max_cmd_len = 16;
 	shost->use_cmd_list = 1;
 
+	if (aac_cfg_major == -2)
+		aac_init_char();
+
 	aac = (struct aac_dev *)shost->hostdata;
 	aac->base_start = pci_resource_start(pdev, 0);
 	aac->scsi_host_ptr = shost;
@@ -1536,7 +1546,7 @@ static void aac_remove_one(struct pci_dev *pdev)
 	pci_disable_device(pdev);
 	if (list_empty(&aac_devices)) {
 		unregister_chrdev(aac_cfg_major, "aac");
-		aac_cfg_major = -1;
+		aac_cfg_major = -2;
 	}
 }
 
@@ -1697,11 +1707,8 @@ static int __init aac_init(void)
 	if (error < 0)
 		return error;
 
-	aac_cfg_major = register_chrdev( 0, "aac", &aac_cfg_fops);
-	if (aac_cfg_major < 0) {
-		printk(KERN_WARNING
-			"aacraid: unable to register \"aac\" device.\n");
-	}
+	aac_init_char();
+
 
 	return 0;
 }
-- 
1.9.1


  parent reply	other threads:[~2015-12-01 19:34 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-01 12:39 [PATCH 00/10] aacraid: Patchset for aacraid driver version 41052 Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 01/10] aacraid: SCSI blk tag support Raghava Aditya Renukunta
2015-12-02 10:49   ` Johannes Thumshirn
2015-12-03 15:52   ` Tomas Henzl
2015-12-03 21:25     ` Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 02/10] aacraid: Fix RRQ overload Raghava Aditya Renukunta
2015-12-02  9:26   ` Johannes Thumshirn
2015-12-04 14:11   ` Tomas Henzl
2015-12-01 12:39 ` [PATCH 03/10] aacraid: Added EEH support Raghava Aditya Renukunta
2015-12-02  9:41   ` Johannes Thumshirn
2015-12-02 23:14     ` Raghava Aditya Renukunta
2015-12-04 14:20   ` Tomas Henzl
2015-12-01 12:39 ` [PATCH 04/10] aacraid: Fix memory leak in aac_fib_map_free Raghava Aditya Renukunta
2015-12-02  9:44   ` Johannes Thumshirn
2015-12-04 14:34   ` Tomas Henzl
2015-12-05  0:40     ` Raghava Aditya Renukunta
2015-12-07 14:05       ` Tomas Henzl
2015-12-07 19:07         ` Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 05/10] aacraid: Set correct msix count for EEH recovery Raghava Aditya Renukunta
2015-12-02 10:27   ` Johannes Thumshirn
2015-12-02 22:59     ` Raghava Aditya Renukunta
2015-12-04 14:10   ` Tomas Henzl
2015-12-05  0:15     ` Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 06/10] aacraid: Fundamental reset support for Series 7 Raghava Aditya Renukunta
2015-12-02  9:49   ` Johannes Thumshirn
2015-12-01 12:39 ` [PATCH 07/10] aacraid: Fix AIF triggered IOP_RESET Raghava Aditya Renukunta
2015-12-02 10:00   ` Johannes Thumshirn
2015-12-02 22:29     ` Raghava Aditya Renukunta
2015-12-03  8:03       ` Johannes Thumshirn
2015-12-01 12:39 ` [PATCH 08/10] aacraid: Disable device ID wildcard Raghava Aditya Renukunta
2015-12-02 10:02   ` Johannes Thumshirn
2015-12-03 15:54   ` Tomas Henzl
2015-12-03 21:32     ` Raghava Aditya Renukunta
2015-12-04  8:33       ` Christoph Hellwig
2015-12-07 19:07         ` Raghava Aditya Renukunta
2015-12-01 12:39 ` Raghava Aditya Renukunta [this message]
2015-12-02 10:13   ` [PATCH 09/10] aacraid: Fix character device re-initialization Johannes Thumshirn
2015-12-02 22:30     ` Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 09/10] aacraid: Fix character device re initialization Raghava Aditya Renukunta
2015-12-02  9:18   ` Johannes Thumshirn
2015-12-02 21:59     ` Raghava Aditya Renukunta
2015-12-01 12:39 ` [PATCH 10/10] aacraid: Update driver version Raghava Aditya Renukunta
2015-12-02 10:14   ` Johannes Thumshirn

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=1448973589-9216-10-git-send-email-RaghavaAditya.Renukunta@pmcs.com \
    --to=raghavaaditya.renukunta@pmcs.com \
    --cc=Gana.Sridaran@pmcs.com \
    --cc=JBottomley@Parallels.com \
    --cc=Mahesh.Rajashekhara@pmcs.com \
    --cc=Murthy.Bhat@pmcs.com \
    --cc=Rich.Bono@pmcs.com \
    --cc=Santosh.Akula@pmcs.com \
    --cc=aacraid@pmc-sierra.com \
    --cc=linux-scsi@vger.kernel.org \
    /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.