Re: [PATCH 2/4] usb: host: ehci-hcd: Add controller_resets_phy quirk

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

 



Hi Matthieu,

On 2/9/2011 9:31 PM, Matthieu CASTET wrote:
> Benoit Goby a écrit :
>> From: Gary King <gking@xxxxxxxxxx>
>>
>> Tegra quirk: Resetting the controller has the side effect of resetting
>> the PHY. Only reset the controller when doing so won't also reset the
>> phy.
>>
>> Signed-off-by: Gary King <gking@xxxxxxxxxx>
>> Signed-off-by: Benoit Goby <benoit@xxxxxxxxxxx>
>> ---
>>  drivers/usb/host/ehci-hcd.c |    3 ++-
>>  drivers/usb/host/ehci.h     |    1 +
>>  2 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
>> index 30515d3..7afa345 100644
>> --- a/drivers/usb/host/ehci-hcd.c
>> +++ b/drivers/usb/host/ehci-hcd.c
>> @@ -275,7 +275,8 @@ static int ehci_reset (struct ehci_hcd *ehci)
>>  
>>  	command |= CMD_RESET;
>>  	dbg_cmd (ehci, "reset", command);
>> -	ehci_writel(ehci, command, &ehci->regs->command);
>> +	if (!ehci->controller_resets_phy)
>> +		ehci_writel(ehci, command, &ehci->regs->command);
>>  	ehci_to_hcd(ehci)->state = HC_STATE_HALT;
>>  	ehci->next_statechange = jiffies;
>>  	retval = handshake (ehci, &ehci->regs->command,
>> diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
>> index f86d3fa..8854491 100644
>> --- a/drivers/usb/host/ehci.h
>> +++ b/drivers/usb/host/ehci.h
>> @@ -134,6 +134,7 @@ struct ehci_hcd {			/* one per controller */
>>  	unsigned		amd_pll_fix:1;
>>  	unsigned		fs_i_thresh:1;	/* Intel iso scheduling */
>>  	unsigned		use_dummy_qh:1;	/* AMD Frame List table quirk*/
>> +	unsigned		controller_resets_phy:1; /* Tegra quirk */
>>  
>>  	/* required for usb32 quirk */
>>  	#define OHCI_CTRL_HCFS          (3 << 6)
> Instead of something that prevent reset, shouldn't tdi platform have a 
> callback to restore phy config ?
> 
> And I think we should use ehci_is_TDI(ehci) condition. No need to 
> introduce another flags. The problem is common to all tdi core.
> 
> Matthieu
> 
> 
> PS : This may help to remove ehci_msm_run.

The reason for having ehci_msm_run is to configure some MSM specific
registers (not just the HC mode bit) after controller reset. In the
current code, there is no way HCD can register it's own tdi_reset
method. If we can have such mechanism, then ehci_msm_run() can be removed.

Thanks,
Pavan

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux