From: Tomas Henzl <thenzl@redhat.com>
To: Raghava Aditya Renukunta <RaghavaAditya.Renukunta@pmcs.com>,
"James.Bottomley@HansenPartnership.com"
<James.Bottomley@HansenPartnership.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>
Cc: Mahesh Rajashekhara <Mahesh.Rajashekhara@pmcs.com>,
Murthy Bhat <Murthy.Bhat@pmcs.com>,
Gana Sridaran <Gana.Sridaran@pmcs.com>,
"aacraid@pmc-sierra.com" <aacraid@pmc-sierra.com>,
Scott Benesh <Scott.Benesh@pmcs.com>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"shane.seymour@hpe.com" <shane.seymour@hpe.com>,
zzzDavid Carroll <David.Carroll@pmcs.com>
Subject: Re: [PATCH V3 8/9] aacraid: Fix character device re-initialization
Date: Fri, 22 Jan 2016 14:08:23 +0100 [thread overview]
Message-ID: <56A229C7.5040003@redhat.com> (raw)
In-Reply-To: <198D06D448A18D4E93F08FB849C4E39D7D1F6AE0@BBYEXM01.pmc-sierra.internal>
On 20.1.2016 21:43, Raghava Aditya Renukunta wrote:
> Hello Tomas,
>
>> -----Original Message-----
>> From: Tomas Henzl [mailto:thenzl@redhat.com]
>> Sent: Wednesday, January 20, 2016 5:41 AM
>> To: Raghava Aditya Renukunta; James.Bottomley@HansenPartnership.com;
>> martin.petersen@oracle.com; linux-scsi@vger.kernel.org
>> Cc: Mahesh Rajashekhara; Murthy Bhat; Gana Sridaran; aacraid@pmc-
>> sierra.com; Scott Benesh; jthumshirn@suse.de; shane.seymour@hpe.com;
>> zzzDavid Carroll
>> Subject: Re: [PATCH V3 8/9] aacraid: Fix character device re-initialization
>>
>> On 15.1.2016 08:16, Raghava Aditya Renukunta wrote:
>>> 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.
>>>
>>> Changes in V2:
>>> Added macros to track character device state
>>>
>>> Changes in V3:
>>> None
>>>
>>> Signed-off-by: Raghava Aditya Renukunta
>> <raghavaaditya.renukunta@pmcs.com>
>>> Reviewed-by: Shane Seymour <shane.seymour@hpe.com>
>> Hi Raghava,
>> when aacraid is loaded (modprobe) without an controller attached to the
>> system
>> the driver loads and creates the character device. Later when you hotplug a
>> device and remove again we see the driver loaded but now without the
>> char device. I'd prefer consistency here - either create the char device
>> when the first controller is probed (preferred) or do not remove it
>> until the driver exits.
>> This is not a nack, just a wish that you changed it in next series.
>>
>> --tm
>
> Yes I will make the necessary changes so that character device is created when
> The controller is probed, and when the driver is removed (aac_remove_one),delete
> the character device. I will keep the character device during resume and suspend.
>
> Do you want to do this in the next version of the patches or the next series of patches after this one is
> Accepted. ?
sure, next series is fine, as I wrote already
>
> Regards,
> Raghava Aditya
>
>
>>> ---
>>> drivers/scsi/aacraid/aacraid.h | 7 +++++++
>>> drivers/scsi/aacraid/linit.c | 21 ++++++++++++++-------
>>> 2 files changed, 21 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
>>> index 3473668..4b669ef 100644
>>> --- a/drivers/scsi/aacraid/aacraid.h
>>> +++ b/drivers/scsi/aacraid/aacraid.h
>>> @@ -94,6 +94,13 @@ enum {
>>> #define aac_phys_to_logical(x) ((x)+1)
>>> #define aac_logical_to_phys(x) ((x)?(x)-1:0)
>>>
>>> +/*
>>> + * These macros are for keeping track of
>>> + * character device state.
>>> + */
>>> +#define AAC_CHARDEV_UNREGISTERED (-1)
>>> +#define AAC_CHARDEV_NEEDS_REINIT (-2)
>>> +
>>> /* #define AAC_DETAILED_STATUS_INFO */
>>>
>>> struct diskparm
>>> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
>>> index 27b3fcd..057c07c 100644
>>> --- a/drivers/scsi/aacraid/linit.c
>>> +++ b/drivers/scsi/aacraid/linit.c
>>> @@ -80,7 +80,7 @@ MODULE_VERSION(AAC_DRIVER_FULL_VERSION);
>>>
>>> static DEFINE_MUTEX(aac_mutex);
>>> static LIST_HEAD(aac_devices);
>>> -static int aac_cfg_major = -1;
>>> +static int aac_cfg_major = AAC_CHARDEV_UNREGISTERED;
>>> char aac_driver_version[] = AAC_DRIVER_FULL_VERSION;
>>>
>>> /*
>>> @@ -1125,6 +1125,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)
>>> {
>>> @@ -1182,6 +1189,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 == AAC_CHARDEV_NEEDS_REINIT)
>>> + aac_init_char();
>>> +
>>> aac = (struct aac_dev *)shost->hostdata;
>>> aac->base_start = pci_resource_start(pdev, 0);
>>> aac->scsi_host_ptr = shost;
>>> @@ -1519,7 +1529,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 = AAC_CHARDEV_NEEDS_REINIT;
>>> }
>>> }
>>>
>>> @@ -1681,11 +1691,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;
>>> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-01-22 13:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-15 7:16 [PATCH V3 0/9] aacraid: Patchset for aacraid driver version 41052 Raghava Aditya Renukunta
2016-01-15 7:16 ` [PATCH V3 1/9] aacraid: SCSI blk tag support Raghava Aditya Renukunta
2016-01-15 0:17 ` Seymour, Shane M
2016-01-18 11:13 ` Johannes Thumshirn
2016-01-19 15:33 ` Tomas Henzl
2016-01-15 7:16 ` [PATCH V3 2/9] aacraid: Fix RRQ overload Raghava Aditya Renukunta
2016-01-15 7:16 ` [PATCH V3 3/9] aacraid: Added EEH support Raghava Aditya Renukunta
2016-01-18 11:16 ` Johannes Thumshirn
2016-01-23 22:55 ` kbuild test robot
2016-01-15 7:16 ` [PATCH V3 4/9] aacraid: Fix memory leak in aac_fib_map_free Raghava Aditya Renukunta
2016-01-15 7:16 ` [PATCH V3 5/9] aacraid: Set correct msix count for EEH recovery Raghava Aditya Renukunta
2016-01-18 11:18 ` Johannes Thumshirn
2016-01-15 7:16 ` [PATCH V3 6/9] aacraid: Fundamental reset support for Series 7 Raghava Aditya Renukunta
2016-01-19 15:43 ` Tomas Henzl
2016-01-15 7:16 ` [PATCH V3 7/9] aacraid: Fix AIF triggered IOP_RESET Raghava Aditya Renukunta
2016-01-14 23:35 ` Seymour, Shane M
2016-01-18 11:56 ` Johannes Thumshirn
2016-01-19 16:14 ` Tomas Henzl
2016-01-20 20:32 ` Raghava Aditya Renukunta
2016-01-22 13:14 ` Tomas Henzl
2016-01-23 5:07 ` Raghava Aditya Renukunta
2016-01-27 2:31 ` Martin K. Petersen
2016-01-27 18:02 ` Raghava Aditya Renukunta
2016-01-15 7:16 ` [PATCH V3 8/9] aacraid: Fix character device re-initialization Raghava Aditya Renukunta
2016-01-18 11:58 ` Johannes Thumshirn
2016-01-20 13:41 ` Tomas Henzl
2016-01-20 20:43 ` Raghava Aditya Renukunta
2016-01-22 13:08 ` Tomas Henzl [this message]
2016-01-23 5:07 ` Raghava Aditya Renukunta
2016-01-15 7:16 ` [PATCH V3 9/9] aacraid: Update driver version Raghava Aditya Renukunta
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=56A229C7.5040003@redhat.com \
--to=thenzl@redhat.com \
--cc=David.Carroll@pmcs.com \
--cc=Gana.Sridaran@pmcs.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Mahesh.Rajashekhara@pmcs.com \
--cc=Murthy.Bhat@pmcs.com \
--cc=RaghavaAditya.Renukunta@pmcs.com \
--cc=Scott.Benesh@pmcs.com \
--cc=aacraid@pmc-sierra.com \
--cc=jthumshirn@suse.de \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=shane.seymour@hpe.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).