[no subject]

2014-11-14 Thread Angelo Dureghello

unsubscribe linux-usb angel...@gmail.com
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-11-12 Thread Angelo Dureghello

Hi

don't know if you have already fixed this, anyway,
i finally solved with this patch,

iff --git a/drivers/usb/musb/da8xx.c 
b/../linux-3.17/drivers/usb/musb/da8xx.c

index 4e13fe2..058775e 100644
--- a/drivers/usb/musb/da8xx.c
+++ b/../linux-3.17/drivers/usb/musb/da8xx.c
@@ -184,11 +184,6 @@ static void da8xx_musb_set_vbus(struct musb *musb, 
int is_on)

 #definePOLL_SECONDS2

 static struct timer_list otg_workaround;
-/*
- * angelo,
- * usb host fix must triggered from inside interrupt
- */
-static int reset_fix = 0;

 static void otg_timer(unsigned long _musb)
 {
@@ -254,33 +249,6 @@ static void otg_timer(unsigned long _musb)
 mod_timer(otg_workaround, jiffies + POLL_SECONDS * HZ);
 else
 musb-xceiv-state = OTG_STATE_A_IDLE;
-
-if (reset_fix) {
-u32 cfgchip2;
-
-reset_fix = 0;
-
-MUSB_HST_MODE(musb);
-musb-xceiv-state = OTG_STATE_A_WAIT_VRISE;
-
-cfgchip2 = __raw_readl(
-DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-/*
- * angelo, fix step 2
- *
- * after have set force_host in a first step,
- * we need now to set as OTG and re-enable
- * bus comparators so that DRVVBUS interrupt
- * can be triggered at 5V presence
- */
-cfgchip2 = ~CFGCHIP2_OTGMODE;
-cfgchip2 |= (CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN);
-
-__raw_writel(cfgchip2,
-DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-}
-
 break;
 default:
 break;
@@ -388,25 +356,6 @@ static irqreturn_t da8xx_musb_interrupt(int irq, 
void *hci)

 otg-default_a = 0;
 musb-xceiv-state = OTG_STATE_B_IDLE;
 portstate(musb-port1_status = ~USB_PORT_STAT_POWER);
-
-if (devctl == 0x98) {
-u32 cfgchip2;
-/*
- * angelo, fix, part 2
- * - set host mode only
- * - override vbus / id comparators
- */
-cfgchip2 = __raw_readl(
- DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-cfgchip2 |=   CFGCHIP2_FORCE_HOST;
-cfgchip2 = ~(CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN);
-
-__raw_writel(cfgchip2,
- DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP2_REG));
-
-reset_fix = 1;
-}
 }

 dev_dbg(musb-controller, VBUS %s (%s)%s, devctl %02x\n,



In this way i can have the VBUS interrupt to happen again at next
reinsertion.

Regards





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


Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-11-05 Thread Angelo Dureghello

I have some more, hope useful info on this issue,
i am working now in MUSB_OTG mode, as default

See what is happening on the table below.

Device (arm, am1808 cpu) boots

 state
eventchanges to  devctl

boot
interruptb_idle  0x81  (b1001, B device, session start)
interrupta_wait_vrise0x19  (b00011001, A device, above VBUS valid)
key inserted
interrupta_host  0x5d  (b01011101, A device, host mode,above 
VBUS valid)
interrupta_host  0x5d (b01011101, A device, host mode,above 
VBUS valid)
interrupt a_host  0x5d  (b01011101, A device, host mode,above 
VBUS valid)


interruptrepeated several times

key removed (some scsi I/O errors appears)
interruptb_idle  0x98  (b10011000, B device, above VBUS 
valid, session end)
interruptb_idle  0x99  (b10011001, B device, above VBUS 
valid, session start)


from here, there is no more reaction and / or interrupt happening
inserting or removing the key. State remains stucked on b_host.



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


Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-11-04 Thread Angelo Dureghello

Hi all,

was switched to other tasks last week and couldn't contribute.




Seems MUSB is also broken on OMAP3 boards, booting in OTG mode I'm not
able to make it work when a pendrive is connected to the port. Forcing
HOST mode I get following messages:

[   13.244567] usb 2-1: new high-speed USB device number 2 using musb-hdrc
[   13.503234] usb 2-1: device v058f p6387 is not supported
[   13.592346] usb usb2-port1: unable to enumerate USB device


You need to disable CONFIG_USB_OTG_WHITELIST option to avoid this.
Or add your device to white list of supported devices.

I don't have actually that option enabled.

Thanks, right, with this option disabled I can enumerate the device.
OTOH the big problem is OTG doesn't switch between peripheric mode and
host mode. The use case is as follows:

1. Start the board with OTG mode, nothing connected to the port.
2. Plug a pendrive with an adaptor that sets the ID pin to low.

In that case the no device is detected.


I am testing 2 non-working cases:

1)
If i set musb to work as HOST only mode, (i am setting this into
arch/arm/mach-davinci/usb.c) usb stick is detected
and mounted, but, after this i see da8xx_musb_interrupt()
routine called continuously spamming the console, until i remove
the usb stick. After that, the interrupt is never happening anymore
even at a new re-insertion of the stick.

2)
If i let the driver as default (OTG), usb stick is properly detected
at every insertion and removal, but just after the insertion i receive
the VBUS error, but the 5V of course are there (measured).

My board(am1808 based) has USB ID connected fixed to ground.

I am proceeding on investigations.

Regards
Angelo

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


Re: usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-10-26 Thread Angelo Dureghello

Had some progresses:

on kernel 3.17, musb controller driver is set to start as OTG mode as 
default. So as first thing, since my board has ID pin shorted to ground, 
i changed the default mode to MUSB_HOST., as it was on kernel 3.5.1


So with same settings of 3.5.1 now key is detected correctly at first 
insertion, but after a removal, the stick is not detected anymore.


Issue seems visible in drivers/usb/musb/da8xx.c, inside irqreturn_t 
da8xx_musb_interrupt() routine.


looking the /sys fs, i see that the mode moves in time order as:

|boot:   vbus off  b_idle||
boot:   vbus off  a_wait_vrise||
insertion:  vbus off  a_host|
removal:vbus off  b_idle

After last b_host, the state never moves back to a_wait_vrise.

After the removal, the interrupt call irqreturn_t da8xx_musb_interrupt() 
seems broken and seems never called anymore.


Regards.

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


usb media detection issue on USB_MUSB_HDRC on kernel 3.17

2014-10-25 Thread Angelo Dureghello

Hi,

i am moving from kernel 3.5.1 to 3.17, on a custom AM1808(arm) based
board.I could have host usb working inserting a usb key, but after
removing it, a second insertion of the stick is not detected anymore.

I had to enable the broken Kconfig option into /drivers/usb/musb/Kconfig:

 config USB_MUSB_DAVINCI

 config USB_MUSB_DA8XX
tristate DA8xx/OMAP-L1x
depends on ARCH_DAVINCI_DA8XX
-   depends on BROKEN


Even if the driver can work in OTG mode, i set up the MUSB controller
driver to work in MUSB_HOST mode, as it was in kernel 3.5.1, enabling the
same .config and board options.

Seems like something get corrupted after the first usb stick removal.

dmesg, booting

...
davinci_mmc da830-mmc.1: Can't get dma_tx channel
davinci_mmc da830-mmc.1: Using PIO, 4-bit mode
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
davinci-mcbsp davinci-mcbsp.0: Runtime PM disabled, clock forced on.
davinci-mcbsp davinci-mcbsp.0: Runtime PM disabled, clock forced on.


then, i insert the usb stick:

[root@test ~]#
usb 1-1: new high-speed USB device number 2 using musb-hdrc
usb-storage 1-1:1.0: USB Mass Storage device detected
scsi host0: usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access USB 2.0  USB Flash Drive  1100 PQ: 0 ANSI: 4
sd 0:0:0:0: [sda] 31950720 512-byte logical blocks: (16.3 GB/15.2 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] No Caching mode page found
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Attached SCSI removable disk
Automount: /dev/sda1 inserted
Creating /tmp/.usbmstg0p1


The i remove the usb stick

usb 1-1: USB disconnect, device number 2
FAT-fs (sda1): unable to read boot sector to mark fs as dirty

re-insert
nothing happen anymore.

I am studying into drivers to find a solutions.
Every help is veru appreciated.

Thanks
Regards
Angelo

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