Origen Mounting thumb drive as Mass storage USB OTG Device to Host PC and format gives errors

Bug #893015 reported by Kishore Kanna S
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linaro-landing-team-samsung
Fix Released
Low
Sangwook Lee

Bug Description

Hwpack : hwpack_linaro-lt-origen_20111117-1_armel_supported.tar.gz

1. Insert thumb drive into Origen target.
2. Do modprobe g_mass_storage file="/dev/sda" removable=1 ( Note: /dev/sda is the device node of thumb drive)
3. Connect to the Host with OTG cable from target.
4. Format the USB Mass storage device mounted.

Step4 gives following error.

Error formatting volume
Method "FilesystemCreate" with signature "sas" on interface

visibility: private → public
Usman Ahmad (usman-ah)
Changed in linaro-landing-team-samsung:
importance: Undecided → Low
Changed in linaro-landing-team-samsung:
assignee: nobody → Giridhar BM (giridhar-bm)
Sangwook Lee (sangwook)
Changed in linaro-landing-team-samsung:
assignee: Giridhar BM (giridhar-bm) → Sangwook Lee (sangwook)
Usman Ahmad (usman-ah)
Changed in linaro-landing-team-samsung:
milestone: none → 2012.03
Revision history for this message
Sangwook Lee (sangwook) wrote :

I can reproduce this errors in the tracking branch.

git://git.linaro.org/landing-teams/working/samsung/kernel.git (tracking) samsung-lt-v3.3-rc5-3

which is using the latest patchs for s3c-hsotg.c

Changed in linaro-landing-team-samsung:
status: New → Confirmed
Revision history for this message
Sangwook Lee (sangwook) wrote :
Download full text (4.1 KiB)

= Detection Log Message ==

== From Origen Board==

root@linaro-desktop:~# modprobe g_mass_storage file="/dev/sda" removable=1
[ 255.300000] gadget: Mass Storage Function, version: 2009/09/11
[ 255.300000] gadget: Number of LUNs=1
[ 255.305000] lun0: LUN: removable file: /dev/sda
[ 255.310000] gadget: Mass Storage Gadget, version: 2009/09/11
[ 255.315000] gadget: userspace failed to provide iSerialNumber
[ 255.320000] gadget: g_mass_storage ready
[ 255.325000] s3c_hsotg_phy_enable: pdev 0xc0560128
[ 255.335000] s3c-hsotg s3c-hsotg: S3C_GINTSTS_USBSusp
[ 255.345000] s3c-hsotg s3c-hsotg: bound driver g_mass_storage
root@linaro-desktop:~# [ 255.585000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 255.605000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 255.605000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 255.680000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 255.690000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 255.755000] s3c-hsotg s3c-hsotg: new address 28
[ 255.790000] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[ 255.795000] s3c-hsotg s3c-hsotg: ep0: failed to become enabled (DxEPCTL=0x00008000)?
[ 256.805000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 1)
[ 256.810000] s3c-hsotg s3c-hsotg: s3c_hsotg_start_req: ep1 is stalled
[ 256.815000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 0)
[ 256.825000] s3c-hsotg s3c-hsotg: ep1: failed to become enabled (DxEPCTL=0x00488200)?
[ 256.830000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 1)
[ 256.835000] s3c-hsotg s3c-hsotg: s3c_hsotg_start_req: ep1 is stalled
[ 256.845000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 0)
[ 256.865000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 1)
[ 256.870000] s3c-hsotg s3c-hsotg: s3c_hsotg_start_req: ep1 is stalled
[ 256.875000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 0)
[ 256.950000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_disable(ep ec8d906c)
[ 256.950000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 256.950000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_disable(ep ec8d90d8)
[ 256.965000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 256.965000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 257.030000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 257.040000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 257.105000] s3c-hsotg s3c-hsotg: new address 28
[ 257.135000] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[ 257.145000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 1)
[ 257.150000] s3c-hsotg s3c-hsotg: s3c_hsotg_start_req: ep1 is stalled
[ 257.155000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ec8d906c ep1in, 0)

== Host Side computer ==
Mar 12 12:43:16 Train999 kernel: [13350.964204] usb 1-1.5.3: new high speed USB device using ehci_hcd and address 28
Mar 12 12:43:16 Train999 kernel: [13351.089882] usb-storage 1-1.5.3:1.0: Quirks match for vid 0525 pid a4a5: 10000
Mar 12 12:43:16 Train999 kernel: [13351.091789] scsi13 : usb-storage 1-1.5.3:1.0
Mar 12 12:43:17 Train999 kernel: [13352.085405] scsi 13:0:0:0: Direct-Access Linux File-CD...

Read more...

Revision history for this message
Sangwook Lee (sangwook) wrote :

Data Path:
========
 S3C OTG <-> G Mass Storage <-> File System <-> USB OHCI <->USB stick

Problems
==========
possibilities can be shown, according to error messages (attached)
1) The issues comes from USB OHCI
2) The issues comes from s3c-hsotgc

Physical USB Phy
=============
root@linaro-desktop:~# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=exynos-ohci/3p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=s5p-ehci/3p, 480M
root@linaro-desktop:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Revision history for this message
Sangwook Lee (sangwook) wrote :

Additional issues:

1) Removing g_mass_storage cause kernel panics with the function s3c_hsotg_udc_stop in s3c-hsotg.c

2) This happens regardless of EHCI or OHCI

Revision history for this message
Sangwook Lee (sangwook) wrote :

For kernel panic for g_mass_storage:
===============================

1) Insert module
root@linaro-desktop:~# modprobe g_file_storage file=/var/backing_file
[ 4280.670000] s3c_hsotg_phy_enable: pdev 0xc055a128

2) rmmod g_file_storage

root@linaro-desktop:~# rmmod g_file_storage
[ 4286.285000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_disable: called for ep0
[ 4286.290000] Unable to handle kernel NULL pointer dereference at virtual address 00000040
[ 4286.300000] pgd = ed294000
[ 4286.300000] [00000040] *pgd=6caae831, *pte=00000000, *ppte=00000000
[ 4286.305000] Internal error: Oops: 17 [#1] PREEMPT SMP
[ 4286.310000] Modules linked in: g_file_storage(-) ath6kl ipv6
[ 4286.315000] CPU: 0 Not tainted (3.3.0-rc5-00002-gd9ff28f-dirty #4)
[ 4286.325000] PC is at fsg_unbind+0x20/0x15c [g_file_storage]
[ 4286.330000] LR is at fsg_unbind+0x14/0x15c [g_file_storage]
[ 4286.335000] pc : [<bf0794f0>] lr : [<bf0794e4>] psr: a0000013
.....
[ 4286.470000] [<bf0794f0>] (fsg_unbind+0x20/0x15c [g_file_storage]) from [<c023e940>] (s3c_hsotg_udc_stop+0)
[ 4286.480000] [<c023e940>] (s3c_hsotg_udc_stop+0xb4/0x120) from [<c023ce04>] (usb_gadget_remove_driver+0x64)
[ 4286.490000] [<c023ce04>] (usb_gadget_remove_driver+0x64/0xac) from [<c023ceb8>] (usb_gadget_unregister_dr)
[ 4286.500000] [<c023ceb8>] (usb_gadget_unregister_driver+0x6c/0x88) from [<bf07d5cc>] (fsg_cleanup+0x2c/0x6)
[ 4286.510000] [<bf07d5cc>] (fsg_cleanup+0x2c/0x68 [g_file_storage]) from [<c0063a80>] (sys_delete_module+0x)
[ 4286.520000] [<c0063a80>] (sys_delete_module+0x170/0x234) from [<c000e140>] (ret_fast_syscall+0x0/0x30)
[ 4286.530000] Code: eb45d7bd e1a08000 e2801068 e3a00000 (e598b040)
[ 4286.540000] ---[ end trace 43946f51cc2e18a1 ]---
Segmentation fault

Revision history for this message
Sangwook Lee (sangwook) wrote :

Kernel panic issue regarding rmmod gadget driver
=======================================
Either rmmod g_mass_storage or g_file_storage makes the same kernel panic

How to produce
===============
root@linaro-desktop:~# modprobe g_mass_storage file="/dev/sda"
[ 495.595000] s3c_hsotg_phy_enable: pdev 0xc055a128
root@linaro-desktop:~# rmmod g_mass_storage

Kernel oops
===========

[ 506.280000] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
[ 506.290000] pgd = ed378000
[ 506.290000] [0000000c] *pgd=6c3e3831, *pte=00000000, *ppte=00000000
[ 506.295000] Internal error: Oops: 17 [#1] PREEMPT SMP
[ 506.295000] Modules linked in: g_mass_storage(-) ath6kl ipv6
[ 506.295000] CPU: 1 Not tainted (3.3.0-rc5-00002-gd9ff28f-dirty #5)
[ 506.295000] PC is at composite_unbind+0x14/0x164 [g_mass_storage]
[ 506.295000] LR is at composite_unbind+0x14/0x164 [g_mass_storage]
...............

[ 506.295000] [<bf079e3c>] (composite_unbind+0x14/0x164 [g_mass_storage]) from [<c023e950>] (s3c_hsotg_ud)
[ 506.295000] [<c023e950>] (s3c_hsotg_udc_stop+0xc4/0x12c) from [<c023ce04>] (usb_gadget_remove_driver+0x)
[ 506.295000] [<c023ce04>] (usb_gadget_remove_driver+0x64/0xac) from [<c023ceb8>] (usb_gadget_unregister_)
[ 506.295000] [<c023ceb8>] (usb_gadget_unregister_driver+0x6c/0x88) from [<c0063a80>] (sys_delete_module+)
[ 506.295000] [<c0063a80>] (sys_delete_module+0x170/0x234) from [<c000e140>] (ret_fast_syscall+0x0/0x30)
[ 506.295000] Code: e2809020 e1a0b000 e1a00009 eb45d567 (e590300c)

Revision history for this message
Sangwook Lee (sangwook) wrote :

I am attaching a patch for rmmod kernel panic, still need further testing.

Revision history for this message
Sangwook Lee (sangwook) wrote :

s3c-hsotg.c still has old style gadget driver, it need to be updated.

When rmmod s3c_hostog, kernel panics:
==================================

[ 73.425000] ------------[ cut here ]------------
[ 73.430000] WARNING: at drivers/base/core.c:194 device_release+0x7c/0x80()
[ 73.435000] Device 'gadget' does not have a release() function, it is broken and must be fixed.
[ 73.445000] Modules linked in: s3c_hsotg(-)
[ 73.450000] [<c0014624>] (unwind_backtrace+0x0/0xf8) from [<c0023298>] (warn_slowpath_common+0x54/0x64)
[ 73.460000] [<c0023298>] (warn_slowpath_common+0x54/0x64) from [<c002333c>] (warn_slowpath_fmt+0x30/0x40)
[ 73.470000] [<c002333c>] (warn_slowpath_fmt+0x30/0x40) from [<c01e282c>] (device_release+0x7c/0x80)
[ 73.475000] [<c01e282c>] (device_release+0x7c/0x80) from [<c017fc28>] (kobject_release+0x4c/0x80)
[ 73.485000] [<c017fc28>] (kobject_release+0x4c/0x80) from [<bf002c7c>] (s3c_hsotg_remove+0x78/0x88 [s3c_hsotg])
[ 73.495000] [<bf002c7c>] (s3c_hsotg_remove+0x78/0x88 [s3c_hsotg]) from [<c01e6774>] (platform_drv_remove+0x18/0x1c)
[ 73.505000] [<c01e6774>] (platform_drv_remove+0x18/0x1c) from [<c01e517c>] (__device_release_driver+0x70/0xc0)
[ 73.515000] [<c01e517c>] (__device_release_driver+0x70/0xc0) from [<c01e57ac>] (driver_detach+0xac/0xb0)
[ 73.525000] [<c01e57ac>] (driver_detach+0xac/0xb0) from [<c01e5038>] (bus_remove_driver+0x7c/0xc0)
[ 73.535000] [<c01e5038>] (bus_remove_driver+0x7c/0xc0) from [<c0063a80>] (sys_delete_module+0x170/0x234)
[ 73.545000] [<c0063a80>] (sys_delete_module+0x170/0x234) from [<c000e140>] (ret_fast_syscall+0x0/0x30)
[ 73.555000] ---[ end trace e8a2effa6ddb1635 ]---

=====================================

Changed in linaro-landing-team-samsung:
milestone: 2012.03 → 2012.04
Changed in linaro-landing-team-samsung:
milestone: 2012.04 → 2012.05
Changed in linaro-landing-team-samsung:
milestone: 2012.05 → 2012.06
Revision history for this message
Sangwook Lee (sangwook) wrote :

It works fine with the latest branch:

GIT:
git://git.linaro.org/landing-teams/working/samsung/kernel.git

Tag:
 samsung-linux-3.4-rc7-2012.05-1

BRANCH:
or tracking

Origen(Exynos)
==============
#Install module
$ modprobe g_mass_storage file="/dev/sda"

#Message from remote format
[ 2155.210000] s3c-hsotg s3c-hsotg: new address 40
[ 2155.250000] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[ 2155.255000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ed0f706c ep1in, 1)
[ 2155.265000] s3c-hsotg s3c-hsotg: s3c_hsotg_start_req: ep1 is stalled
[ 2155.270000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_sethalt(ep ed0f706c ep1in, 0)
[ 2155.305000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_disable(ep ed0f706c)
[ 2155.305000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 2155.310000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 2155.315000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 2155.325000] s3c-hsotg s3c-hsotg: s3c_hsotg_ep_disable(ep ed0f70d8)
[ 2155.385000] s3c-hsotg s3c-hsotg: s3c_hsotg_irq: USBRst
[ 2155.395000] s3c-hsotg s3c-hsotg: new device is high-speed
[ 2155.470000] s3c-hsotg s3c-hsotg: new address 40

---[Repeat]--------------------

Host Side
============
[1] Origen(USB thumb driver ) is attached to PC

[2] Unmount /format
$ umount /media/C06F-2C21
$ sudo mkfs.vfat /dev/sdf1

[25358.804241] sd 11:0:0:0: [sdf] Media Changed
[25358.804250] sd 11:0:0:0: [sdf] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[25358.804257] sd 11:0:0:0: [sdf] Sense Key : Unit Attention [current]
[25358.804266] sd 11:0:0:0: [sdf] Add. Sense: Power on, reset, or bus device reset occurred
[25358.804276] sd 11:0:0:0: [sdf] CDB: Read(10): 28 00 00 00 22 50 00 00 08 00
[25358.804295] end_request: I/O error, dev sdf, sector 8784
[25358.827280] sd 11:0:0:0: [sdf] Assuming drive cache: write through
[25358.855443] sd 11:0:0:0: [sdf] Assuming drive cache: write through

Changed in linaro-landing-team-samsung:
status: Confirmed → Fix Committed
Changed in linaro-landing-team-samsung:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.