Re: [PATCH 5/6] qla4xxx: Capture minidump for ISP82XX on firmware failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Looks like my earlier email fails to go on scsi-liist. Resending email.

From:  Vikas <vikas.chaudhary@xxxxxxxxxx>
Date:  Thu, 3 May 2012 04:30:11 -0700
To:  Mike Christie <michaelc@xxxxxxxxxxx>
Cc:  "jbottomley@xxxxxxxxxxxxx" <jbottomley@xxxxxxxxxxxxx>, scsi
<linux-scsi@xxxxxxxxxxxxxxx>, Lalit Chandivade
<lalit.chandivade@xxxxxxxxxx>, Ravi Anand <ravi.anand@xxxxxxxxxx>, Tej
Parkash <tej.parkash@xxxxxxxxxx>, Shyam Sundar <shyam.sundar@xxxxxxxxxx>
Subject:  Re: [PATCH 5/6] qla4xxx: Capture minidump for ISP82XX on
firmware failure


>
>-----Original Message-----
>From: Mike Christie <michaelc@xxxxxxxxxxx>
>Date: Fri, 27 Apr 2012 09:05:15 -0700
>To: Vikas <vikas.chaudhary@xxxxxxxxxx>
>Cc: "jbottomley@xxxxxxxxxxxxx" <jbottomley@xxxxxxxxxxxxx>, scsi
><linux-scsi@xxxxxxxxxxxxxxx>, Lalit Chandivade
><lalit.chandivade@xxxxxxxxxx>, Ravi Anand <ravi.anand@xxxxxxxxxx>, Tej
>Parkash <tej.parkash@xxxxxxxxxx>, Shyam Sundar <shyam.sundar@xxxxxxxxxx>
>Subject: Re: [PATCH 5/6] qla4xxx: Capture minidump for ISP82XX on
>firmware failure
>
>>On 04/24/2012 12:32 AM, vikas.chaudhary@xxxxxxxxxx wrote:
>>> +
>>> +static ssize_t
>>> +qla4_8xxx_sysfs_write_fw_dump(struct file *filep, struct kobject
>>>*kobj,
>>> +                         struct bin_attribute *ba, char *buf, loff_t off,
>>> +                         size_t count)
>>> +{
>>> +   struct scsi_qla_host *ha =
>>>to_qla_host(dev_to_shost(container_of(kobj,
>>> +                                          struct device, kobj)));
>>> +   uint32_t dev_state;
>>> +   int reading;
>>> +
>>> +   if (!is_qla8022(ha))
>>> +           return -EINVAL;
>>> +
>>> +   if (off != 0)
>>> +           return 0;
>>> +
>>> +   reading = simple_strtol(buf, NULL, 10);
>>
>>I think we are supposed to be using kstrtol now.
>
>
>We tried using kstrtol but most of times we found kstrtol return error.
>
>We added following patch to debug this issue:-
>
>--- a/drivers/scsi/qla4xxx/ql4_attr.c
>+++ b/drivers/scsi/qla4xxx/ql4_attr.c
>@@ -35,7 +35,8 @@ qla4_8xxx_sysfs_write_fw_dump(struct file *filep,
>struct kobject *kobj,
>        struct scsi_qla_host *ha =
>to_qla_host(dev_to_shost(container_of(kobj,
>                                               struct device, kobj)));
>        uint32_t dev_state;
>-       int reading;
>+       long reading;
>+       int read, ret;
>
>        if (is_qla40XX(ha))
>                return -EINVAL;
>@@ -43,7 +44,20 @@ qla4_8xxx_sysfs_write_fw_dump(struct file *filep,
>struct kobject *kobj,
>        if (off != 0)
>                return 0;
>
>-       reading = simple_strtol(buf, NULL, 10);
>+       printk("------------------------------------------\n");
>+       ql4_printk(KERN_INFO, ha, "Buf = %s\n", buf);
>+       printk("------------------------------------------\n");
>+       read = simple_strtol(buf, NULL, 10);
>+       ql4_printk(KERN_INFO, ha, "simple strtol val = %d\n", read);
>+       ret = kstrtol(buf, 10, &reading);
>+       if (ret) {
>+               ql4_printk(KERN_INFO, ha, "\nError %d\n", ret);
>+               ql4_printk(KERN_INFO, ha, "Error Converted Val %ld\n",
>reading);
>
>+               return ret;
>+       }
>+       ql4_printk(KERN_INFO, ha, "kstrtol val = %ld\n", reading);
>+       return count;
>+
>        switch (reading) {
>        case 0:
>                /* clear dump collection flags */
>
>
>----
>
>When we do:
># echo 6 > /sys/class/scsi_host/host7/device/fw_dump
>We get following result for this patch:-
>--------------------------------------------------------------------------
>----------------------------------------------------
>May  3 16:45:59 magana kernel: ------------------------------------------
>May  3 16:45:59 magana kernel: qla4xxx 0000:18:00.4: Buf = 6./../../host7
>May  3 16:45:59 magana kernel: ------------------------------------------
>May  3 16:45:59 magana kernel: qla4xxx 0000:18:00.4: simple strtol val = 6
>May  3 16:45:59 magana kernel: qla4xxx 0000:18:00.4:
>May  3 16:45:59 magana kernel: Error -22
>May  3 16:45:59 magana kernel: qla4xxx 0000:18:00.4: Error Converted Val
>-2129482613
>
>--------------------------------------------------------------------------
>----------------------------------------------------
>
>From above logs looks like sysfs attribute reading some extra garbage
>characters because of which
>'kstrtol()' fails but in same case 'simple_strtol()' works fine.
>
>Do you have any idea why we are getting some garbage characters from
>sysfs attribute?
>
>Can you please accept this patch with 'simple_strtol()' till this issue
>get fixed.
>Once it is fix we will update the patch.
>
>Thanks,
>Vikas.
>


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photos]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux