[PATCH v4] ufs: introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk

2016-11-22 Thread Kiwoong Kim
Some UFS host controllers may think granularities of PRDT length and offset as bytes, not double words. Signed-off-by: Kiwoong Kim --- V2: change the name of the quirk (UFSHCD_QUIRK_BROKEN_DWORD_UTRD -> UFSHCD_QUIRK_PRDT_BYTE_GRAN) V3: (rebased to for-next tip) V4: (rebased to 4.10/scsi-qu

[PATCH v3] ufs: introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk

2016-11-18 Thread Kiwoong Kim
Some UFS host controllers may think granularities of PRDT length and offset as bytes, not double words. Signed-off-by: Kiwoong Kim --- V2: change the name of the quirk (UFSHCD_QUIRK_BROKEN_DWORD_UTRD -> UFSHCD_QUIRK_PRDT_BYTE_GRAN) V3: (rebased to 4.10/scsi-queue tip) --- drivers/scsi/

RE: [PATCH v3] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-17 Thread Kiwoong Kim
> On 2016-11-15 21:03, Kiwoong Kim wrote: > > Some UFS host controllers may clear a transfer request slot > > by setting an associated bit in UTRLCLR/UTMRLCLR to 1, not 0. > > That's opposite to what UFS spec describes. > > > > This was the comment on v

[PATCH v3] ufs: add a variety of definitions decribed in UFS spec

2016-11-15 Thread Kiwoong Kim
These things are defined to be used by some UFS Host controllers. And a new file for some declarations of mphy standard is added Signed-off-by: Kiwoong Kim --- V3: add new macros of all bits of UECDL --- drivers/scsi/ufs/mphy.h | 38 ++ drivers/scsi/ufs

RE: [PATCH v2] ufs: add a variety of definitions decribed in UFS spec

2016-11-15 Thread Kiwoong Kim
> On 2016-11-15 03:24, Kiwoong Kim wrote: > > These things are defined to be used by some UFS Host controllers. > > And a new file for some declarations of mphy standard is added > > > > V2 > > - modify the commit message > > - add a new macro for UECD

[PATCH v3] ufs: introduce UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR quirk

2016-11-15 Thread Kiwoong Kim
should be able to refresh interrupt aggreation counter or timer in other way, such as doing it automatically when receiving any response. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 3 ++- drivers/scsi/ufs/ufshcd.h | 7 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff

[PATCH v3] ufs: introduce UFSHCD_QUIRK_BROKEN_HCE quirk

2016-11-15 Thread Kiwoong Kim
Some UFS host controllers might not be able to reset UIC by setting HCE to 1. Those controllers should invoke 'DME reset' and 'DME enable' in order instead. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 44 +++- drivers/sc

[PATCH v3] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-15 Thread Kiwoong Kim
Some UFS host controllers may clear a transfer request slot by setting an associated bit in UTRLCLR/UTMRLCLR to 1, not 0. That's opposite to what UFS spec describes. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 28 ++-- drivers/scsi/ufs/ufshcd.h

RE: [PATCH v2] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-15 Thread Kiwoong Kim
Rest all looks good but i will wait for updated patch fixing above before >> giving Reviewed-By. >> >> > >> > Signed-off-by: Kiwoong Kim >> > --- >> > drivers/scsi/ufs/ufshcd.c | 28 ++-- >> > drivers/scsi/ufs/ufshcd.h | 7

[PATCH v2] ufs: add a variety of definitions decribed in UFS spec

2016-11-15 Thread Kiwoong Kim
/IS_PWR_MODE_PWM/IS_PWM_PWR_MODE) Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/mphy.h | 38 ++ drivers/scsi/ufs/ufshci.h | 17 ++--- drivers/scsi/ufs/unipro.h | 26 ++ 3 files changed, 78 insertions(+), 3 deletions(-) create

[PATCH v2] ufs: introduce UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR quirk

2016-11-15 Thread Kiwoong Kim
should be able to refresh interrupt aggreation counter or timer in other way, such as doing it automatically when receiving any response. V2 - modify the commit message - change the name of the quirk (s/ UFSHCI_QUIRK_SKIP_INTR_AGGR/UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR) Signed-off-by: Kiwoong Kim

[PATCH v2] ufs: introduce UFSHCD_QUIRK_BROKEN_HCE quirk

2016-11-15 Thread Kiwoong Kim
Some UFS host controllers might not be able to reset UIC by setting HCE to 1. Those controllers should invoke 'DME reset' and 'DME enable' in order instead. V2 - modify the commit message - change the name of the quirk (s/UFSHCD_QUIRK_USE_OF_HCE/UFSHCD_QUIRK_BROKEN_HCE) Si

[PATCH v2] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-15 Thread Kiwoong Kim
Some UFS host controllers may clear a transfer request slot by setting an associated bit in UTRLCLR/UTMRLCLR to 1, not 0. That's opposite to what UFS spec describes. v2: modify the commit message, remove unrelated changes Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c

[PATCH v2] ufs: introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk

2016-11-15 Thread Kiwoong Kim
Some UFS host controllers may think granularitys of PRDT length and offset as bytes, not double words. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 28 +--- drivers/scsi/ufs/ufshcd.h | 6 ++ 2 files changed, 27 insertions(+), 7 deletions(-) diff --git

[PATCH v2] ufs: introduce hibern8_notify callback

2016-11-10 Thread Kiwoong Kim
Some UFS host controller may need to configure some things around hibern8 enter/exit v2: change the callback name and data type of 2nd argument Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 12 ++-- drivers/scsi/ufs/ufshcd.h | 12 2 files changed, 22

[PATCH v2] ufs: introduce setup_task_mgmt

2016-11-10 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any task management request is issued v2: move a comment to another place Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 12 insertions(+) diff --git

[PATCH v2] ufs: introduce setup_xfer_req callback

2016-11-10 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any transfer request is issued. V2: change data type of 2nd argument Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 12 insertions(+) diff --git a

RE: [PATCH v1] ufs: add a variety of definitions decribed in UFS spec

2016-11-09 Thread Kiwoong Kim
Hi, Subhash I'll update this patch referring what you said below except for creating of "mphy.h". > >> > These things are defined to be used by some UFS Host controllers. > >> > > >> > Signed-off-by: Kiwoong Kim

RE: [PATCH v1] ufs: introduce UFSHCI_QUIRK_SKIP_INTR_AGGR quirk

2016-11-09 Thread Kiwoong Kim
missed. > > That would cause a command timeout. > > > > If UFS driver resets interrupt aggregation timer and counter when > > there is a pending doorbell, a competion interrupt of a corresponing > > task may be issued. > > That would casue a command timeout. > &

RE: [PATCH v1] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-09 Thread Kiwoong Kim
> > Some UFS host controllers may clear a transfer request slot by setting > > an associated bit in UTLRCLR/UTMLRCLR to 1, not 0. > > s/UTLRCLR/UTRLCLR > s/UTMLRCLR/UTMRLCLR > Okay > > > That's opposite to what UFS spec decribes. > > > > Sig

RE: [PATCH v1] ufs: introcude UFSHCD_QUIRK_GET_VS_RESULT quirk

2016-11-08 Thread Kiwoong Kim
> > Some UFS host controllers may not report a result of UIC command > > completion properly. > > In such cases, they should get the result from UIC directly if their > > architectures support that. > > > > Signed-off-by: Kiwoong Kim > &g

RE: [PATCH v1] ufs: introduce setup_hibern8 callback

2016-11-08 Thread Kiwoong Kim
> > Some UFS host controller may need to configure some things around > > hibern8 enter/exit > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/ufshcd.c | 10 -- drivers/scsi/ufs/ufshcd.h > > | 10 ++ > > 2 files change

RE: [PATCH v1] ufs: introduce setup_xfer_req callback

2016-11-08 Thread Kiwoong Kim
> > Some UFS host controller may need to configure some things before any > > transfer request is issued. > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/ufshcd.c | 2 ++ > > drivers/scsi/ufs/ufshcd.h | 10 ++ > > 2 file

RE: [PATCH v1] ufs: introduce setup_task_mgmt

2016-11-08 Thread Kiwoong Kim
> > Some UFS host controller may need to configure some things before any > > task management request is issued > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/ufshcd.c | 1 + > > drivers/scsi/ufs/ufshcd.h | 10 ++ > > 2 fi

RE: [PATCH v1] ufs: introduce UFSHCI_QUIRK_SKIP_INTR_AGGR quirk

2016-11-08 Thread Kiwoong Kim
gregation timer and counter > > when there is a pending doorbell, a competion interrupt > > of a corresponing task may be issued. > > That would casue a command timeout. > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/ufshcd.c | 4 +++- > >

RE: [PATCH v1] ufs: add a variety of definitions decribed in UFS spec

2016-11-08 Thread Kiwoong Kim
> > These things are defined to be used by some UFS Host controllers. > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/mphy.h | 38 ++ > > drivers/scsi/ufs/ufshci.h | 14 +++--

RE: [PATCH v1] ufs: introduce UFSHCD_QUIRK_BROKEN_DWORD_UTRD quirk

2016-11-08 Thread Kiwoong Kim
> > Some UFS host controllers may think > > granularitys of PRDT length and offset as bytes, not double words. > > > > Signed-off-by: Kiwoong Kim > > --- > > drivers/scsi/ufs/ufshcd.c | 24 +++- > > drivers/scsi/ufs/ufshcd.h | 2 ++

RE: [PATCH v1] ufs: introduce UFSHCD_QUIRK_USE_OF_HCE quirk

2016-11-08 Thread Kiwoong Kim
> On 2016-11-07 23:57, Kiwoong Kim wrote: > > Some host controller might not initialize itself by setting "Host > > Controller Enable" to 1. > > > They should do this to reset UIC. > > I am not sure if i understood this statment. can you give more detai

[RESEND][PATCH v1] ufs: introduce setup_task_mgmt

2016-11-08 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any task management request is issued. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 1 + drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b

[PATCH v1] ufs: add a variety of definitions decribed in UFS spec

2016-11-08 Thread Kiwoong Kim
These things are defined to be used by some UFS Host controllers. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/mphy.h | 38 ++ drivers/scsi/ufs/ufshci.h | 14 +++--- drivers/scsi/ufs/unipro.h | 24 3 files changed, 73

[PATCH v1] ufs: introduce UFSHCI_QUIRK_SKIP_INTR_AGGR quirk

2016-11-08 Thread Kiwoong Kim
competion interrupt of a corresponing task may be issued. That would casue a command timeout. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 4 +++- drivers/scsi/ufs/ufshcd.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

[PATCH v1] ufs: introduce setup_hibern8 callback

2016-11-07 Thread Kiwoong Kim
Some UFS host controller may need to configure some things around hibern8 enter/exit Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 10 -- drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b

[PATCH v1] ufs: introduce setup_task_mgmt

2016-11-07 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any task management request is issued Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 1 + drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers

[PATCH v1] ufs: introduce UFSHCD_QUIRK_USE_OF_HCE quirk

2016-11-07 Thread Kiwoong Kim
Some host controller might not initialize itself by setting "Host Controller Enable" to 1. They should do this to reset UIC. In such cases, 'DME reset' and 'DME enable' are required for normal subsequent operations. Signed-off-by: Kiwoong Kim ---

[PATCH v1] ufs: introduce UFSHCD_QUIRK_BROKEN_REQ_LIST_CLR quirk

2016-11-07 Thread Kiwoong Kim
Some UFS host controllers may clear a transfer request slot by setting an associated bit in UTLRCLR/UTMLRCLR to 1, not 0. That's opposite to what UFS spec decribes. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 32 drivers/scsi/ufs/ufshcd.h

[PATCH v1] ufs: introcude UFSHCD_QUIRK_GET_VS_RESULT quirk

2016-11-07 Thread Kiwoong Kim
Some UFS host controllers may not report a result of UIC command completion properly. In such cases, they should get the result from UIC directly if their architectures support that. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 27 +++ drivers/scsi/ufs

[PATCH v1] ufs: introduce UFSHCD_QUIRK_BROKEN_DWORD_UTRD quirk

2016-11-07 Thread Kiwoong Kim
Some UFS host controllers may think granularitys of PRDT length and offset as bytes, not double words. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 24 +++- drivers/scsi/ufs/ufshcd.h | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a

[PATCH v1] ufs: introduce setup_xfer_req callback

2016-11-07 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any transfer request is issued. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 2 ++ drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi

RE: [RESEND PATCH v3] scsi: ufshcd: fix possible unclocked register access

2016-10-07 Thread Kiwoong Kim
Reviewed-by: Kiwoong Kim > Vendor specific setup_clocks callback may require the clocks managed > by ufshcd driver to be ON. So if the vendor specific setup_clocks callback > is called while the required clocks are turned off, it could result into > unclocked register access. >

[PATCH 01/10] ufs: introduce setup_xfer_req callback

2016-10-07 Thread Kiwoong Kim
Some UFS host controller may need to configure some things before any transfer request is issued. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c |2 ++ drivers/scsi/ufs/ufshcd.h | 10 ++ 2 files changed, 12 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers

[RESEND PATCH v2 0/10] Support for Exynos specific UFS driver

2016-10-07 Thread Kiwoong Kim
This series of patches introduce support for Exynos specific UFS driver. An original version of this has been applied on mass production of commercial mobile devices. I checked compiling with Subhash's patch - [PATCH v3] scsi: ufshcd: fix possible unclocked register access --- Changes from v1: *

[PATCH v2 0/8] Support for Exynos specific UFS driver

2016-10-07 Thread Kiwoong Kim
This series of patches introduce support for Exynos specific UFS driver. An original version of this has been applied on mass production of commercial mobile devices. I checked compiling with Subhash's patch - [PATCH v3] scsi: ufshcd: fix possible unclocked register access --- Changes from v1: *

RE: [PATCH v1 1/8] ufs: add some vendor specific operations

2016-10-06 Thread Kiwoong Kim
Hi, Subhash. > Hi Kim, > > On 2016-10-06 18:38, Kiwoong Kim wrote: > > Hi, Subhash. > > > > Thank for your comments. > > I added my opinions below. > > > > Regards > > > >> Hi Kim, > >> > >> > >> On 2016-1

RE: [PATCH v1 1/8] ufs: add some vendor specific operations

2016-10-06 Thread Kiwoong Kim
Hi, Subhash. Thank for your comments. I added my opinions below. Regards > Hi Kim, > > > On 2016-10-06 01:17, Kiwoong Kim wrote: > > Some UFS host controller may need to require some sequences before > > used clocks are turned on or off. > > e.g) control intern

RE: [PATCH v1 0/8] Support for Exynos specific UFS driver

2016-10-06 Thread Kiwoong Kim
Hi, Subhash You're right. I submitted one of patches first to link to the previous summary mail thread, but it failed. I'll try it again. Thank you Regards > Hi Kim, > > > On 2016-10-06 01:12, Kiwoong Kim wrote: > > This series of patches introduce support for Ex

RE: [PATCH v2] scsi: ufshcd: fix possible unclocked register access

2016-10-06 Thread Kiwoong Kim
Hi, Subhash. > Thanks Kim for the response. > > On 2016-10-06 03:28, Kiwoong Kim wrote: > > Hi, Subhash. > > > > Some UFS host controllers may need to call the vendor specific > > callback before and after controlling by clock control framework, > > reg

RE: [PATCH v2] scsi: ufshcd: fix possible unclocked register access

2016-10-06 Thread Kiwoong Kim
Hi, Subhash. Some UFS host controllers may need to call the vendor specific callback before and after controlling by clock control framework, regardless of whether available clocks are turned on or off. Is there any special reason to limit to invoke the callback only when the clocks are turned on

[PATCH v1 0/8] Support for Exynos specific UFS driver

2016-10-06 Thread Kiwoong Kim
This series of patches introduce support for Exynos specific UFS driver. An original version of this has been applied on mass production of commercial mobile devices. Documentation/devicetree/bindings/ufs/ufs-exynos.txt | 93 + drivers/scsi/ufs/Kconfig | 1

[PATCH v1 1/8] ufs: add some vendor specific operations

2016-10-06 Thread Kiwoong Kim
Some UFS host controller may need to require some sequences before used clocks are turned on or off. e.g) control internal gates in UFS host Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 15 +-- drivers/scsi/ufs/ufshcd.h | 37 + 2

RE: [PATCH -next] scsi: ufs: fix error return code in ufshcd_init()

2016-09-29 Thread Kiwoong Kim
Reviewed-by: Kiwoong Kim > -Original Message- > From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- > ow...@vger.kernel.org] On Behalf Of subha...@codeaurora.org > Sent: Thursday, September 29, 2016 7:50 AM > To: Wei Yongjun > Cc: Vinayak Holikatti; James E.J. B

RE: [PATCH v2] UFS: Date Segment only need for WRITE DESCRIPTOR

2016-09-27 Thread Kiwoong Kim
Hi, Martin. I think that the patch is correct. UFS spec says "The Data Segment area is empty" for Read Descriptor. I have been using similar code with it and it works. That have been already applied in Android kernel. Reviewed-by: Kiwoong Kim Regards. > -Original Messag

RE: UFS API in the kernel

2016-09-26 Thread Kiwoong Kim
Hi. If you want to declare some things for user interface, is it be better to put those thing include/uapi/linux/ than include/linux? Agreed with Mr. Pinto's opinion with respect to implementing additional ioctls. Regards. > -Original Message- > From: linux-scsi-ow...@vger.kernel.org [m

[PATCH][SCSI] scsi: ufs: get a TM service response from the correct offset

2016-09-08 Thread Kiwoong Kim
From: Kiwoong Kim When any UFS host controller receives a TM(Task Management) response from a UFS device, UFS driver has been recognize like receiving a message of "Task Management Function Complete"(00h) in all cases, so far. That means there is no pending task for a tag of the TM re

[PATCH][SCSI] ufs: fix a wrong string in power mode change

2016-09-08 Thread Kiwoong Kim
From: Kiwoong Kim I modified a string as described in UFS spec as follow: umpcrs -> upmcrs Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index b0ad