Bug 15001 - megaraid_sas fills dmesg with megasas: Failed to copy out to user sense data
megaraid_sas fills dmesg with megasas: Failed to copy out to user sense data
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Product: SCSI Drivers
Classification: Unclassified
Component: Other
All Linux
: P1 normal
Assigned To: scsi_drivers-other
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-07 12:42 UTC by Alex
Modified: 2010-02-11 13:30 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.31.8 2.6.31.9 2.6.31.10
Tree: Mainline
Regression: Yes


Attachments
dmesg (27.67 KB, text/x-log)
2010-01-11 11:04 UTC, Alex
Details
patch to handle compat apps (1.10 KB, patch)
2010-02-03 13:41 UTC, Tomas Henzl
Details | Diff

Description Alex 2010-01-07 12:42:02 UTC
starting from 2.6.31.8 megaraid_sas driver fills dmesg with 

megasas: Failed to copy out to user sense data


I donwloaded and build megaraid_sas from dell site :  megaraid_sas-v00.00.04.17

but without any result , I still get this messages .

on 2.6.31.7 it worked just fine .


uname -a
Linux myhost 2.6.31.10-grsec #1 SMP Thu Jan 7 11:13:42 CET 2010 x86_64 GNU/Linux


 modinfo megaraid_sas
filename:       /lib/modules/2.6.31.10-grsec/kernel/drivers/scsi/megaraid/megaraid_sas.ko
description:    LSI MegaRAID SAS Driver
author:         megaraidlinux@lsi.com
version:        00.00.04.01
license:        GPL
srcversion:     78C40B2F67D5AE7885571F9
alias:          pci:v00001028d00000015sv*sd*bc*sc*i*
alias:          pci:v00001000d00000413sv*sd*bc*sc*i*
alias:          pci:v00001000d00000079sv*sd*bc*sc*i*
alias:          pci:v00001000d00000078sv*sd*bc*sc*i*
alias:          pci:v00001000d0000007Csv*sd*bc*sc*i*
alias:          pci:v00001000d00000060sv*sd*bc*sc*i*
alias:          pci:v00001000d00000411sv*sd*bc*sc*i*
depends:        scsi_mod
vermagic:       2.6.31.10-grsec SMP mod_unload modversions 
parm:           poll_mode_io:Complete cmds from IO path, (default=0) (int)


#lspci
00:00.0 Host bridge: Intel Corporation QuickPath Architecture I/O Hub to ESI Port (rev 13)
00:01.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 1 (rev 13)
00:03.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 3 (rev 13)
00:04.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 4 (rev 13)
00:05.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 5 (rev 13)
00:06.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 6 (rev 13)
00:07.0 PCI bridge: Intel Corporation QuickPath Architecture I/O Hub PCI Express Root Port 7 (rev 13)
00:14.0 PIC: Intel Corporation QuickPath Architecture I/O Hub System Management Registers (rev 13)
00:14.1 PIC: Intel Corporation QuickPath Architecture I/O Hub GPIO and Scratch Pad Registers (rev 13)
00:14.2 PIC: Intel Corporation QuickPath Architecture I/O Hub Control Status and RAS Registers (rev 13)
00:1a.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #4 (rev 02)
00:1a.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #5 (rev 02)
00:1a.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #2 (rev 02)
00:1d.0 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #1 (rev 02)
00:1d.1 USB Controller: Intel Corporation 82801I (ICH9 Family) USB UHCI Controller #2 (rev 02)
00:1d.7 USB Controller: Intel Corporation 82801I (ICH9 Family) USB2 EHCI Controller #1 (rev 02)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 92)
00:1f.0 ISA bridge: Intel Corporation 82801IB (ICH9) LPC Interface Controller (rev 02)
00:1f.2 IDE interface: Intel Corporation 82801IB (ICH9) 2 port SATA IDE Controller (rev 02)
01:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
01:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
02:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
02:00.1 Ethernet controller: Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet (rev 20)
03:00.0 RAID bus controller: LSI Logic / Symbios Logic MegaRAID SAS 1078 (rev 04)
04:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
04:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
07:03.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200eW WPCM450 [Hermon] - Winbond/Nuvoton (rev 0a)

Please tell me if you need any additional information .
thank you , 
Alex
Comment 1 bo yang 2010-01-08 16:21:12 UTC
We submited 4.12 driver to upstream which accepted by main stream 2.6.33. Is there available to try 4.12?

Thanks,

Bo Yang
Comment 2 Alex 2010-01-11 11:04:26 UTC
Created attachment 24507 [details]
dmesg 

dmesg
Comment 3 Alex 2010-01-11 11:12:51 UTC
Hello , 
so what I have done  :

I copied megaraid directory from 2.6.33-rc3  and compiled module 

here is my Makefile 
obj-$(CONFIG_MEGARAID_MM)       += megaraid_mm.o
obj-$(CONFIG_MEGARAID_MAILBOX)  += megaraid_mbox.o
obj-$(CONFIG_MEGARAID_SAS)      += megaraid_sas.o
KDIR := /lib/modules/2.6.31.11-grsec/build
PWD := $(shell pwd)
default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) CONFIG_DEBUG_SECTION_MISMATCH=y modules

and here is the make's output 

/home/pkg/megaraid/megaraid# make 
make -C /lib/modules/2.6.31.11-grsec/build SUBDIRS=/home/pkg/megaraid/megaraid CONFIG_DEBUG_SECTION_MISMATCH=y modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.31.11-grsec'
  Building modules, stage 2.
  MODPOST 1 modules
WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x30): Section mismatch in reference from the variable megasas_pci_driver to the function .text:megasas_suspend()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x48): Section mismatch in reference from the variable megasas_pci_driver to the function .text:megasas_resume()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x50): Section mismatch in reference from the variable megasas_pci_driver to the function .text:megasas_shutdown()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0xf8): Section mismatch in reference from the variable driver_attr_poll_mode_io to the function .text:megasas_sysfs_show_poll_mode_io()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x100): Section mismatch in reference from the variable driver_attr_poll_mode_io to the function .text:megasas_sysfs_set_poll_mode_io()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x128): Section mismatch in reference from the variable driver_attr_dbg_lvl to the function .text:megasas_sysfs_show_dbg_lvl()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x130): Section mismatch in reference from the variable driver_attr_dbg_lvl to the function .text:megasas_sysfs_set_dbg_lvl()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x158): Section mismatch in reference from the variable driver_attr_release_date to the function .text:megasas_sysfs_show_release_date()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x188): Section mismatch in reference from the variable driver_attr_version to the function .text:megasas_sysfs_show_version()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x1f8): Section mismatch in reference from the variable megasas_template to the function .text:megasas_queue_command()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x210): Section mismatch in reference from the variable megasas_template to the function .text:megasas_reset_device()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x220): Section mismatch in reference from the variable megasas_template to the function .text:megasas_reset_bus_host()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x228): Section mismatch in reference from the variable megasas_template to the function .text:megasas_reset_bus_host()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x230): Section mismatch in reference from the variable megasas_template to the function .text:megasas_slave_alloc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x238): Section mismatch in reference from the variable megasas_template to the function .text:megasas_slave_configure()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x278): Section mismatch in reference from the variable megasas_template to the function .text:megasas_bios_param()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x288): Section mismatch in reference from the variable megasas_template to the function .text:megasas_reset_timer()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x2f0): Section mismatch in reference from the variable megasas_instance_template_ppc to the function .text:megasas_fire_cmd_ppc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x2f8): Section mismatch in reference from the variable megasas_instance_template_ppc to the function .text:megasas_enable_intr_ppc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x300): Section mismatch in reference from the variable megasas_instance_template_ppc to the function .text:megasas_disable_intr_ppc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x308): Section mismatch in reference from the variable megasas_instance_template_ppc to the function .text:megasas_clear_intr_ppc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x310): Section mismatch in reference from the variable megasas_instance_template_ppc to the function .text:megasas_read_fw_status_reg_ppc()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x320): Section mismatch in reference from the variable megasas_instance_template_gen2 to the function .text:megasas_fire_cmd_gen2()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x328): Section mismatch in reference from the variable megasas_instance_template_gen2 to the function .text:megasas_enable_intr_gen2()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x330): Section mismatch in reference from the variable megasas_instance_template_gen2 to the function .text:megasas_disable_intr_gen2()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x338): Section mismatch in reference from the variable megasas_instance_template_gen2 to the function .text:megasas_clear_intr_gen2()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x340): Section mismatch in reference from the variable megasas_instance_template_gen2 to the function .text:megasas_read_fw_status_reg_gen2()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x350): Section mismatch in reference from the variable megasas_instance_template_skinny to the function .text:megasas_fire_cmd_skinny()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x358): Section mismatch in reference from the variable megasas_instance_template_skinny to the function .text:megasas_enable_intr_skinny()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x360): Section mismatch in reference from the variable megasas_instance_template_skinny to the function .text:megasas_disable_intr_skinny()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x368): Section mismatch in reference from the variable megasas_instance_template_skinny to the function .text:megasas_clear_intr_skinny()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x370): Section mismatch in reference from the variable megasas_instance_template_skinny to the function .text:megasas_read_fw_status_reg_skinny()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x380): Section mismatch in reference from the variable megasas_instance_template_xscale to the function .text:megasas_fire_cmd_xscale()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x388): Section mismatch in reference from the variable megasas_instance_template_xscale to the function .text:megasas_enable_intr_xscale()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x390): Section mismatch in reference from the variable megasas_instance_template_xscale to the function .text:megasas_disable_intr_xscale()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x398): Section mismatch in reference from the variable megasas_instance_template_xscale to the function .text:megasas_clear_intr_xscale()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x3a0): Section mismatch in reference from the variable megasas_instance_template_xscale to the function .text:megasas_read_fw_status_reg_xscale()

WARNING: /home/pkg/megaraid/megaraid/megaraid_sas.o(.data+0x3c8): Section mismatch in reference from the variable driver_attr_support_poll_for_event to the function .text:megasas_sysfs_show_support_poll_for_event()

make[1]: Leaving directory `/usr/src/linux-headers-2.6.31.11-grsec'


than I copied megaraid_sas.ko to modules tree and run update-initramfs -uv

after reboot :
uname -a
Linux mydb 2.6.31.11-grsec #1 SMP Fri Jan 8 10:22:54 CET 2010 x86_64 GNU/Linux

modinfo megaraid_sas
filename:       /lib/modules/2.6.31.11-grsec/kernel/misc/megaraid/megaraid_sas.ko
description:    LSI MegaRAID SAS Driver
author:         megaraidlinux@lsi.com
version:        00.00.04.12-rc1
license:        GPL
srcversion:     4B304EFDDEF265C4DB3635B
alias:          pci:v00001028d00000015sv*sd*bc*sc*i*
alias:          pci:v00001000d00000413sv*sd*bc*sc*i*
alias:          pci:v00001000d00000071sv*sd*bc*sc*i*
alias:          pci:v00001000d00000073sv*sd*bc*sc*i*
alias:          pci:v00001000d00000079sv*sd*bc*sc*i*
alias:          pci:v00001000d00000078sv*sd*bc*sc*i*
alias:          pci:v00001000d0000007Csv*sd*bc*sc*i*
alias:          pci:v00001000d00000060sv*sd*bc*sc*i*
alias:          pci:v00001000d00000411sv*sd*bc*sc*i*
depends:        scsi_mod
vermagic:       2.6.31.11-grsec SMP mod_unload 
parm:           poll_mode_io:Complete cmds from IO path, (default=0) (int)


I still get this messages 
megasas: Failed to copy out to user sense data

the same was for 4.17 version which I got from dell site .

dmesg is attached .

and what does this message mean ?
is it harmless ? 

Thank you .
Regards , 
Alex
Comment 4 mi_whitebrook_13 2010-01-15 12:09:43 UTC
This is a "me too" post...

I have a problem since the commit (SCSI: megaraid_sas: fix 64 bit sense pointer truncation) with several Dell 2950 Servers. It happens both on the Perc 5/i and the Perc 6/i controllers. All of these machines have 8GB RAM and are running x86_64 kernels (currently 2.6.32.2). I always get messages like this in the Kernel Log (plus on the console, which is VERY annoying:
[69274.972038] megasas: Failed to copy out to user sense data
[69274.972182] megasas: Failed to copy out to user sense data
[71168.206030] megasas: Failed to copy out to user sense data
[71168.206175] megasas: Failed to copy out to user sense data
 
It happens about 2-5 times per hour, most of the time several of those errors (2-3) are reported in close timely vicinity, like within a few seconds. Other than this these servers seem to be stable, so i guess it is a spurious message caused by above commit. Replacing megaraid_sas.c with the version from Kernel 2.6.32 cures the problem.

I've also tried using version v00.00.04.12-rc1 of megaraid_sas.c (and .h)
from Kernel 2.6.33-rc3 and i can confirm that it shows the same problems
on my hardware:
[70120.567013] megasas: Failed to copy out to user sense data
[70120.576426] megasas: Failed to copy out to user sense data
[70120.576869] megasas: Failed to copy out to user sense data
[70120.587822] megasas: Failed to copy out to user sense data
Comment 5 Tomas Henzl 2010-02-03 13:41:44 UTC
Created attachment 24890 [details]
patch to handle compat apps

The issue is probably caused by a 32bit application in a 64bit os. The 'open manage' here uses a 32bit pointer and the driver after the 'SCSI: megaraid_sas: fix 64 bit sense pointer truncation' works with it as if it was a 64bit pointer.
The attached patch handles the situation on my test box.
Comment 6 Alex 2010-02-04 11:00:54 UTC
(In reply to comment #5)
> Created an attachment (id=24890) [details]
> patch to handle compat apps
> 
> The issue is probably caused by a 32bit application in a 64bit os. The 'open
> manage' here uses a 32bit pointer and the driver after the 'SCSI: megaraid_sas:
> fix 64 bit sense pointer truncation' works with it as if it was a 64bit
> pointer.
> The attached patch handles the situation on my test box.

thank you for the patch , it handles the issue , tested on 2.6.32.7 .
Comment 7 Tomas Henzl 2010-02-04 13:22:20 UTC
(In reply to comment #6)
> thank you for the patch , it handles the issue , tested on 2.6.32.7 .

That means that you no more see the 
"megasas: Failed to copy out to user sense data" 
or have you also verified that the management software works as expected?
Comment 8 Alex 2010-02-04 14:29:46 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > thank you for the patch , it handles the issue , tested on 2.6.32.7 .
> 
> That means that you no more see the 
> "megasas: Failed to copy out to user sense data" 
Yes , that means that I don't see this message any more , 
and what does it mean "Failed to copy out to user sense data" ?
> or have you also verified that the management software works as expected?
And I still can retrieve information with MegaCli utility , should I check something special ?
Comment 9 Tomas Henzl 2010-02-04 15:36:13 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > (In reply to comment #6)
> > > thank you for the patch , it handles the issue , tested on 2.6.32.7 .
> > 
> > That means that you no more see the 
> > "megasas: Failed to copy out to user sense data" 
> Yes , that means that I don't see this message any more , 
> and what does it mean "Failed to copy out to user sense data" ?
That means that the function copy_to_user in the driver failed and the ioctl returned EFAULT. Usually programs can cope with that, but it could mean that they are not able to collect informations from that device.

> > or have you also verified that the management software works as expected?
> And I still can retrieve information with MegaCli utility , should I check
> something special ?
I'm not sure with MegaCli, what I meant here is the Dell management sw 'Open Manage', so if you can check if this sw can collect info from  megaraid driver.
Comment 10 Alex 2010-02-05 07:34:50 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > (In reply to comment #7)
> > > (In reply to comment #6)
> > > > thank you for the patch , it handles the issue , tested on 2.6.32.7 .
> > > 
> > > That means that you no more see the 
> > > "megasas: Failed to copy out to user sense data" 
> > Yes , that means that I don't see this message any more , 
> > and what does it mean "Failed to copy out to user sense data" ?
> That means that the function copy_to_user in the driver failed and the ioctl
> returned EFAULT. Usually programs can cope with that, but it could mean that
> they are not able to collect informations from that device.
> 
> > > or have you also verified that the management software works as expected?
> > And I still can retrieve information with MegaCli utility , should I check
> > something special ?
> I'm not sure with MegaCli, what I meant here is the Dell management sw 'Open
> Manage', so if you can check if this sw can collect info from  megaraid driver.

I guess it is ok , 
OMSA is 6.0.1-8 . For example 
omreport storage vdisk 
omreport storage pdisk controller=0 
works as expected .
Comment 11 Tomas Henzl 2010-02-05 14:51:36 UTC
(In reply to comment #10) 
> I guess it is ok , 
> OMSA is 6.0.1-8 . For example 
> omreport storage vdisk 
> omreport storage pdisk controller=0 
> works as expected .
OK, thanks for testing.
Comment 12 mi_whitebrook_13 2010-02-11 13:30:16 UTC
Applied the patch on all our systems which were exhibiting this bug. The error message in dmesg is gone now. Dell OMSA still works as expected, including omreport and the Dell OpenManage Web Application.
Thanks for the fast fix!

Note You need to log in before you can comment on or make changes to this bug.