Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-28 Thread Joao Pinto
HI,

Solved it.
else if (lrbp->command_type == UTP_CMD_TYPE_DEV_MANAGE || lrbp->command_type ==
DWC_UTRD_CMD_TYPE_UFS_STORAGE)
was also needed ufshcd_transfer_req_compl(). Step by step :)

Thanks.
Joao

On 1/28/2016 6:07 PM, Joao Pinto wrote:
> Hi Akinobu,
> 
> I managed to make the following replacement:
> "lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;" for
> "lrbp->command_type = DWC_UTRD_CMD_TYPE_UFS_STORAGE;" being
> DWC_UTRD_CMD_TYPE_UFS_STORAGE = 0x11
> 
> Now I get OCS = 0 which is good:
> @ [0]:1100
> @0004 [1]:93936a6a
> @0008 [2]:
> @000c [3]:93936a6a
> @0010 [4]:9f317400
> @0014 [5]:
> @0018 [6]:00800080
> @001c [7]:01006a6a
> 
> But now the command is not completed time left is 0 in 
> ufshcd_wait_for_dev_cmd()
> and even after clearing the door bell the issue is not fixed. Did you ever 
> have
> this problem?
> 
> Joao
> 
> On 1/28/2016 5:00 PM, Joao Pinto wrote:
>> Hi Akinobu,
>> Thanks for the tip!
>>
>> Joao
>>
>> On 1/28/2016 12:35 PM, Akinobu Mita wrote:
>>> Hi Joao,
>>>
>>> 2016-01-28 2:04 GMT+09:00 Joao Pinto :
 - NOP_OUT is failing with OCS = 0x7

 The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
 I made a dump of the UTRD pointer where we can check the status = 7 ([2]).

 UTRD at: 7007c3e0
 @ [0]:2100
 @0004 [1]:93936a6a
 @0008 [2]:0007
 @000c [3]:93936a6a
 @0010 [4]:9f317400
 @0014 [5]:
 @0018 [6]:00800080
 @001c [7]:01006a6a

 Did anyone have the same problem? Any hints to overcome this issue?
>>>
>>> I have seen similar problem when using UFS 2.0 controller.
>>>
>>> The ufs driver currently doesn't set correct command type field in
>>> UTP transfer request descriptor (bit 31:28 in DW0) for UFS 2.0
>>> controller.  I checked that your DesignWare UFS driver handles it
>>> correctly, so please try with that change.
>>>
>>
> 

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


Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-28 Thread Joao Pinto
Hi Akinobu,

I managed to make the following replacement:
"lrbp->command_type = UTP_CMD_TYPE_DEV_MANAGE;" for
"lrbp->command_type = DWC_UTRD_CMD_TYPE_UFS_STORAGE;" being
DWC_UTRD_CMD_TYPE_UFS_STORAGE = 0x11

Now I get OCS = 0 which is good:
@ [0]:1100
@0004 [1]:93936a6a
@0008 [2]:
@000c [3]:93936a6a
@0010 [4]:9f317400
@0014 [5]:
@0018 [6]:00800080
@001c [7]:01006a6a

But now the command is not completed time left is 0 in ufshcd_wait_for_dev_cmd()
and even after clearing the door bell the issue is not fixed. Did you ever have
this problem?

Joao

On 1/28/2016 5:00 PM, Joao Pinto wrote:
> Hi Akinobu,
> Thanks for the tip!
> 
> Joao
> 
> On 1/28/2016 12:35 PM, Akinobu Mita wrote:
>> Hi Joao,
>>
>> 2016-01-28 2:04 GMT+09:00 Joao Pinto :
>>> - NOP_OUT is failing with OCS = 0x7
>>>
>>> The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
>>> I made a dump of the UTRD pointer where we can check the status = 7 ([2]).
>>>
>>> UTRD at: 7007c3e0
>>> @ [0]:2100
>>> @0004 [1]:93936a6a
>>> @0008 [2]:0007
>>> @000c [3]:93936a6a
>>> @0010 [4]:9f317400
>>> @0014 [5]:
>>> @0018 [6]:00800080
>>> @001c [7]:01006a6a
>>>
>>> Did anyone have the same problem? Any hints to overcome this issue?
>>
>> I have seen similar problem when using UFS 2.0 controller.
>>
>> The ufs driver currently doesn't set correct command type field in
>> UTP transfer request descriptor (bit 31:28 in DW0) for UFS 2.0
>> controller.  I checked that your DesignWare UFS driver handles it
>> correctly, so please try with that change.
>>
> 

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


Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-28 Thread Joao Pinto
Hi Akinobu,
Thanks for the tip!

Joao

On 1/28/2016 12:35 PM, Akinobu Mita wrote:
> Hi Joao,
> 
> 2016-01-28 2:04 GMT+09:00 Joao Pinto :
>> - NOP_OUT is failing with OCS = 0x7
>>
>> The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
>> I made a dump of the UTRD pointer where we can check the status = 7 ([2]).
>>
>> UTRD at: 7007c3e0
>> @ [0]:2100
>> @0004 [1]:93936a6a
>> @0008 [2]:0007
>> @000c [3]:93936a6a
>> @0010 [4]:9f317400
>> @0014 [5]:
>> @0018 [6]:00800080
>> @001c [7]:01006a6a
>>
>> Did anyone have the same problem? Any hints to overcome this issue?
> 
> I have seen similar problem when using UFS 2.0 controller.
> 
> The ufs driver currently doesn't set correct command type field in
> UTP transfer request descriptor (bit 31:28 in DW0) for UFS 2.0
> controller.  I checked that your DesignWare UFS driver handles it
> correctly, so please try with that change.
> 

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


Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-28 Thread Akinobu Mita
Hi Joao,

2016-01-28 2:04 GMT+09:00 Joao Pinto :
> - NOP_OUT is failing with OCS = 0x7
>
> The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
> I made a dump of the UTRD pointer where we can check the status = 7 ([2]).
>
> UTRD at: 7007c3e0
> @ [0]:2100
> @0004 [1]:93936a6a
> @0008 [2]:0007
> @000c [3]:93936a6a
> @0010 [4]:9f317400
> @0014 [5]:
> @0018 [6]:00800080
> @001c [7]:01006a6a
>
> Did anyone have the same problem? Any hints to overcome this issue?

I have seen similar problem when using UFS 2.0 controller.

The ufs driver currently doesn't set correct command type field in
UTP transfer request descriptor (bit 31:28 in DW0) for UFS 2.0
controller.  I checked that your DesignWare UFS driver handles it
correctly, so please try with that change.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-27 Thread Joao Pinto
Hi!
I am currently working in the implementation of DesignWare Quirks in the
existing UFS core and implementing a glue platform driver.
The project status is the following:

- Synopsys MPHY Test Chip is well configured
- Link is up in Host & Device (validated through the 0xd083 register)
- Additional connection setup are made successfully
- HBA is operational
- NOP_OUT is failing with OCS = 0x7

The OCS value is calculated in ufshcd_get_tr_ocs() in ufshcd.c.
I made a dump of the UTRD pointer where we can check the status = 7 ([2]).

UTRD at: 7007c3e0
@ [0]:2100
@0004 [1]:93936a6a
@0008 [2]:0007
@000c [3]:93936a6a
@0010 [4]:9f317400
@0014 [5]:
@0018 [6]:00800080
@001c [7]:01006a6a

Did anyone have the same problem? Any hints to overcome this issue?

Thank you very much for your help!

Joao

On 1/14/2016 9:58 AM, Joao Pinto wrote:
> Hi,
> 
> On 1/14/2016 2:54 AM, Akinobu Mita wrote:
>> 2016-01-14 3:41 GMT+09:00 Joao Pinto :
>>> I am planning to make some tests with the ufs kernel existing core driver 
>>> in our
>>> setup, but I noticed that despite the scsi/ufs driver package contains a
>>> platform driver, this is not the typical platform driver (glue driver) 
>>> which can
>>> be addressed from device tree. The only one available is the qcom's.
>>> Would I need to submit a designware platform glue driver also as done by 
>>> QCom?
>>
>> Yes.  ufs-pltfrm.c only contains APIs for UFS platform driver since
>> commit 47555a5c8a11a423e6767f942941c745766c99a2 ("scsi: ufs: make the
>> UFS variant a platform device").  Just as you said, you need to add
>> ufs-abc.c as a real platform driver.
> 
> I am going to test the platform I already have and if everything is ok then I
> will submit the patch.
> 
>>
>>> We also need a pci glue driver, but you already have one. In your opinion 
>>> the
>>> best approach is to add synopsys device id to the pci device list in the 
>>> driver
>>> and add quirks or add a new designware pci glue driver?
>>
>> I think you can just add a new device id with vops like this
>>
>> {
>> PCI_DEVICE(PCI_VENDOR_ID_SNPS, PCI_DEVICE_ID_SNPS_HAPS_UFS),
>> .driver_data = (void *)&ufs_hba_dwc_vops,
>> },
>>
>> then bind to hba->vops in ufshcd_pci_probe().If there is remaining
>> host controller specific initialization stuff, let vops->init() do that
>> by ufshcd_init().
>>
> 
> Ok, that's what I thought.
> 
> Thanks for the help!
> 
> Joao
> 

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


Re: [PATCH] add driver for DesignWare UFS Host Controller

2016-01-07 Thread Christoph Hellwig
> This driver patch includes a core driver and glue drivers for pci and platform
> for the DesignWare UFS Host IP.

Why doesn't this use the existing ufs core?  The architecture looks
completely backwards to me.

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