linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug in sysfs bin attribute?
@ 2012-05-23  5:38 Vikas Chaudhary
  2012-05-23  6:17 ` gregkh
  0 siblings, 1 reply; 3+ messages in thread
From: Vikas Chaudhary @ 2012-05-23  5:38 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mike Christie, James Bottomley, Vikas Chaudhary,
	Lalit Chandivade, Ravi Anand, gregkh


We have added sysfs bin_attribute 'fw_dump' in qla4xxx driver.
Here is patch for same: -
http://marc.info/?l=linux-scsi&m=133733192809849&w=2


In this patch in function qla4_8xxx_sysfs_write_fw_dump() if we print
string coming in 'char *buf'
from sysfs attribute it contain value we echo on sysfs attribute 'fw_dump'
plus some garbage data.


If I write "5" to sysfs attribute I am getting following string in buf : -


May 18 12:08:00 magana kernel: ----------------
May 18 12:08:00 magana kernel: buf: 5
May 18 12:08:00 magana kernel: /../../host10           <-- Garbage data
May 18 12:08:00 magana kernel: ----------------



Because of this garbage data kstrtol() fails in function
qla4_8xxx_sysfs_write_fw_dump().
If we use simple_strtol() instate of kstrtol() it works well. But
simple_strtol() is deprecated
so we can't use this API.
Solution to this, for now are writing "0" at buf[1] as we are interested
only in value at buf[0].


I am interested to know if the behavior of sysfs attribute is correct or
is it an issue?



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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in sysfs bin attribute?
  2012-05-23  5:38 Bug in sysfs bin attribute? Vikas Chaudhary
@ 2012-05-23  6:17 ` gregkh
  2012-05-23  8:55   ` Vikas Chaudhary
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2012-05-23  6:17 UTC (permalink / raw)
  To: Vikas Chaudhary
  Cc: linux-kernel, Mike Christie, James Bottomley, Lalit Chandivade,
	Ravi Anand

On Tue, May 22, 2012 at 10:38:11PM -0700, Vikas Chaudhary wrote:
> 
> We have added sysfs bin_attribute 'fw_dump' in qla4xxx driver.
> Here is patch for same: -
> http://marc.info/?l=linux-scsi&m=133733192809849&w=2
> 
> 
> In this patch in function qla4_8xxx_sysfs_write_fw_dump() if we print
> string coming in 'char *buf'
> from sysfs attribute it contain value we echo on sysfs attribute 'fw_dump'
> plus some garbage data.

Why are you not using the built-in firmware interface the kernel
provides you?  What does it lack that you need here?

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in sysfs bin attribute?
  2012-05-23  6:17 ` gregkh
@ 2012-05-23  8:55   ` Vikas Chaudhary
  0 siblings, 0 replies; 3+ messages in thread
From: Vikas Chaudhary @ 2012-05-23  8:55 UTC (permalink / raw)
  To: gregkh
  Cc: linux-kernel, Mike Christie, James Bottomley, Lalit Chandivade,
	Ravi Anand

-----Original Message-----
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>, Mike Christie
<michaelc@cs.wisc.edu>, James Bottomley
<James.Bottomley@HansenPartnership.com>, Lalit Chandivade
<lalit.chandivade@qlogic.com>, Ravi Anand <ravi.anand@qlogic.com>
Subject: Re: Bug in sysfs bin attribute?

>On Tue, May 22, 2012 at 10:38:11PM -0700, Vikas Chaudhary wrote:
>>
>> We have added sysfs bin_attribute 'fw_dump' in qla4xxx driver.
>> Here is patch for same: -
>> http://marc.info/?l=linux-scsi&m=133733192809849&w=2
>>
>>
>> In this patch in function qla4_8xxx_sysfs_write_fw_dump() if we print
>> string coming in 'char *buf'
>> from sysfs attribute it contain value we echo on sysfs attribute
>>'fw_dump'
>> plus some garbage data.
>
>Why are you not using the built-in firmware interface the kernel
>provides you?  What does it lack that you need here?

In this patch we are not trying to load firmware, Here we are trying to
collect
firmware dump in case of adapter firmware crash. The firmware dump is in
driver buffer
and we want to extract it at user space using the sysfs bin attribute.


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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-23  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-23  5:38 Bug in sysfs bin attribute? Vikas Chaudhary
2012-05-23  6:17 ` gregkh
2012-05-23  8:55   ` Vikas Chaudhary

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).