Reviewed-by: Gilad Broner
> Some UFS devices (and may be host) have issues if LCC is
> enabled. So we are setting PA_Local_TX_LCC_Enable to 0
> before link startup which will make sure that both host
> and device TX LCC are disabled once link startup is
> completed.
>
>
Reviewed-by: Gilad Broner
> This change adds printouts of testbus and debug registers.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 77
> +
> drivers/scsi/ufs/ufs-qcom.h | 9 ++
> 2 f
Reviewed-by: Gilad Broner
> This change enables the device ref clock before changing to HS mode
> and disables it if entered to PWM mode.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 12
> drivers/scsi/ufs/ufshcd.h | 9
Looks good to me.
Reviewed-by: Gilad Broner
> V2:
> This series should be pushed on top of 15 patches series:
> "Big fixes, retries, handle a race condition"
> fixed and few comments.
>
> V1:
> This series should be pushed on top of 15 patches series:
>
Reviewed-by: Gilad Broner
> New revisions of UFS host controller supports the new UniPro
> hardware controller (referred as QUniPro). This patch adds
> the support to enable this new UniPro controller hardware.
>
> This change also adds power optimization for bus scaling featur
Reviewed-by: Gilad Broner
> Adds support for configuring and reading the test bus and debug
> registers. This change also adds another vops in order to print the
> debug registers.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/s
Reviewed-by: Gilad Broner
> In order to simplify the code a set of wrapper functions is created
> to test and call each of the variant operations.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 1 -
> drivers/s
Reviewed-by: Gilad Broner
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 34 +-
> drivers/scsi/ufs/ufshcd.h | 21 +
> 2 files changed, 38 insertions(+), 17 deletions(-)
>
> diff --git a/drive
Reviewed-by: Gilad Broner
> This change turns the UFS variant (SCSI_UFS_QCOM) into a UFS
> a platform device.
> In order to do so a few additional changes are required:
> 1. The ufshcd-pltfrm is no longer serves as a platform device.
>Now it only serves as a group of platform
Reviewed-by: Gilad Broner
> When sending a query to the device returns with a timeout error,
> we clear the corresponding bit in the DOORBELL register but
> we don't clear the outstanding_request field as we should.
> This patch fixes this bug.
>
> Signed-off-by: Yaniv Ga
Reviewed-by: Gilad Broner
> This change is required in order to be able to build the component
> as a module.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/
Reviewed-by: Gilad Broner
> This change fixes a compilation warning that happens if SCSI_UFS_QCOM
> is compiled as a module.
> Also this patch fixes an error happens when insmod the module:
> "ufs_qcom: module license 'unspecified' taints kernel."
Reviewed-by: Gilad Broner
> Export the following functions in order to avoid build errors
> when the component PHY_QCOM_UFS is compiled as a module:
>
> ERROR: "ufs_qcom_phy_disable_ref_clk"
> [drivers/scsi/ufs/ufs-qcom.ko] undefined!
> ERROR: "ufs_qcom_phy
Reviewed-by: Gilad Broner
> If hibern8 enter command fails then UFS link state may be unknown which
> may result into timeout of all the commands issued after failure.
>
> This change does 2 things (for pre-defined number of retry counts) after
> hibern8 enter failure:
> 1. Rec
Reviewed-by: Gilad Broner
> Sometimes queries from the device might return a failure so it is
> recommended to retry sending the query, before giving up.
> This change adds a wrapper to retry sending a query attribute,
> in cases where we need to wait longer, before we continue,
Looks OK.
Reviewed-by: Gilad Broner
> Some of the data structures (like response UPIU) and/or its elements
> (unused fields) should be cleared before sending out the respective
> command to UFS device.
>
> This change clears the UPIU response data structure for query commands
&g
Reviewed-by: Gilad Broner
> The dme_peer get/set attribute commands are prone to errors, therefore
> we add three retries for the UIC command sending.
> Error code returned from ufshcd_send_uic_cmd() is checked, and unless
> it was successful or the retries have finished, another com
Reviewed-by: Gilad Broner
> DME commands such as Hibern8 enter/exit and gear switch generate 2
> completion interrupts, one for confirmation that command is received
> by local UniPro and 2nd one is the final confirmation after communication
> with remote UniPro. Currently b
Reviewed-by: Gilad Broner
> Hibern8 exit can be called from 3 different context:
> - ufshcd_hibern8_exit_work
> - ufshcd_ungate_work
> - runtime/system resume
>
> If hibern8 exit fails for some reason then we try to bring the link to
> active state by link star
Reviewed-by: Gilad Broner
> If device raises the exception event in the response to the commands
> sent during the runtime/system PM callbacks, exception event handler
> might run in parallel with PM callbacks and may see unclocked register
> accesses. This change fixes this
Reviewed-by: Gilad Broner
> fDeviceInit query response time for some devices is too long that default
> query request timeout of 100ms may not be enough. Experiments show that
> fDeviceInit response sometimes takes 500ms so to be on safer side this
> change sets the timeout to 60
Looks OK.
Reviewed-by: Gilad Broner
> Clear the UFS data structures before sending new request.
>
> The SCSI command is sent to the device within the UFS UPIU request.
> As part of the transfer UPIU preparation, the SCSI command is copied
> to the UPIU structure according to t
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
: Yaniv Gardi
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/ufs.h| 53 +++---
drivers/scsi/ufs/ufshcd.c | 219 +-
include/scsi/scsi.h | 1 +
include/uapi/scsi/Kbuild | 1 +
include/uapi/scsi/ufs/Kbuild | 3 +
include
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 3 +-
drivers/scsi/ufs/ufs-debugfs.c | 901 +
driver
Changes from V7:
Fix handling of copy_from_user() result in case of incomplete copy in
ufshcd_query_ioctl().
Fix ufs-debugfs build in case UFS is configured as a loadable kernel module.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace
> copy_to/from_user() returns the number of bytes not copied and not an
> error code. Printing these error messages in the ioctl means the user
> can trigger a DoS by filling up /var/log/messages. They make the code
> uglier. We should stop here if the copy fails and goto out_release_mem
> other
+-
> drivers/scsi/ufs/ufs-qcom.h | 18 ++
> drivers/scsi/ufs/ufshcd.c | 35 +++
> drivers/scsi/ufs/ufshcd.h | 9 +
> 4 files changed, 79 insertions(+), 5 deletions(-)
>
Reviewed-by: Gilad Broner
--
Qualcomm
ion in internal structure.
>
> Signed-off-by: Yaniv Gardi
>
> ---
> drivers/scsi/ufs/ufs-qcom.c | 14 +++---
> drivers/scsi/ufs/ufs-qcom.h | 8
> 2 files changed, 15 insertions(+), 7 deletions(-)
>
Reviewed-by: Gilad Broner
--
Qualcomm Israel, on be
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
Changes from V6:
Moved NULL user argument check from ufshcd_ioctl to ufshcd_query_ioctl.
Add comment in include/scsi/scsi.h to note 0x5388 is in use.
*** BLURB HERE ***
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
Changes from V6:
Moved NULL user argument check from ufshcd_ioctl to ufshcd_query_ioctl.
Add comment in include/scsi/scsi.h to note 0x5388 is in use.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for debug
Lee
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
>> + if (!buffer) {
>> + dev_err(hba->dev, "%s: User buffer is NULL!\n",
>> __func__);
>> + return -EINVAL;
>> + }
>> +
>
> Should we remove this check or move it into ufshcd_query_ioctl()?
> For example, BLKFLS ioctl without argument is correct usage, but
>
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
Changes from V5:
Created a common trace event class for driver state changes instead
of individual trace events definitions.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for debug
Lee Susman (1):
scsi: ufs
> This and the auto_bkops_state is pretty much the same. Can't you use
> the same TP_printk() and just have a DECLARE_EVENT_CLASS? The trace
> point name is printed with the event to see different events.
I agree. will upload the fix in next patchset.
--
Qualcomm Israel, on behalf of Qualcomm In
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
Changes from V4:
Dropped error injection change titled:
scsi: ufs: inject errors to verify error handling
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for debug
Lee Susman (1):
scsi: ufs: add debugfs for
> Check for null before being dereferenced to avoid a invalid null
> dereference.
>
> Found using Coccinelle.
>
> Signed-off-by: Tapasweni Pathak
> Acked-by: Julia Lawall
> ---
> drivers/scsi/ufs/ufshcd.c |7 +--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/
>> +static bool inject_cmd_hang_tr(struct ufs_hba *hba)
>> +{
>> + int tag;
>> +
>> + tag = find_first_bit(&hba->outstanding_reqs, hba->nutrs);
>> + if (tag == hba->nutrs)
>> + return 0;
>> +
>> + __clear_bit(tag, &hba->outstanding_reqs);
>> + hba->lrb[ta
From: Sujit Reddy Thumma
Use fault-injection framework to simulate error conditions
in the controller and verify error handling mechanisms
implemented in UFS host controller driver.
This is used only during development and hence
guarded by CONFIG_UFS_FAULT_INJECTION debug config option.
Signed-
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
Changes from V3:
Changed tag statistics macros to functions and removed redundant
call to ufsdbg_remove_debugfs().
Other minor changes fixing previous comments.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for
> If I understand the patch above, you basically have:
>
> if ()
> goto out;
> else
> ret = ufshcd_resume();
> out:
>
> Wouldn't it be better to just reverse the above if condition?
>
> if (!...)
> ret = ufshcd_resume();
>
> That would
>> +#define UFSHCD_UPDATE_TAG_STATS(hba, tag)
>> +#define UFSHCD_UPDATE_TAG_STATS_COMPLETION(hba, cmd)
>> +#define UFSHCD_UPDATE_ERROR_STATS(hba, type)
>> +
>> +#endif
>
> Is there any reason that these are defined as macros instead of
> static functions?
No special reason that I'm aware of. I wil
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
From: Sujit Reddy Thumma
Use fault-injection framework to simulate error conditions
in the controller and verify error handling mechanisms
implemented in UFS host controller driver.
This is used only during development and hence
guarded by CONFIG_UFS_FAULT_INJECTION debug config option.
Signed-
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
Changes from V2:
Fixed comment for debugfs change:
Added missing clean up to driver unload path and remove redundant macros.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for debug
Lee Susman (1):
scsi: ufs
> UFSDBG_REMOVE_DEBUGFS() is not called in the driver unloading path.
> So ufs debugfs directory is not removed when unloading driver. It
> should be called in ufshcd_remove().
>
> BTW, do we really need UFSDBG_ADD_DEBUGFS() and UFSDBG_REMOVE_DEBUGFS()
> macros?
> We can use static inline function
>> struct ufs_stats {
>> +#ifdef CONFIG_DEBUG_FS
>> bool enabled;
>> u64 **tag_stats;
>> int q_depth;
>> int err_stats[UFS_ERR_MAX];
>> +#endif
>
> Can any of the tracepoint code be called that references these when
> CONFIG_DEBUG_FS is not set? Because soon (possibly even this
> Should we append the index for unique directory
> name for each contoroller like "ufs0", "ufs1", ...?
I agree - uploaded patch V2 in which this is handled.
Thanks,
Gilad.
--
Qualcomm Israel, on behalf of Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Changes from V1:
- Renamed debugfs.* to ufs-debugfs.*
- Added host controller instance number to ufs debug-fs entry name.
- Removed FTRACE_EVENT_ENABLED macro as it was redundant.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/ufs-debugfs.c | 902 +
drivers/sc
From: Sujit Reddy Thumma
Use fault-injection framework to simulate error conditions
in the controller and verify error handling mechanisms
implemented in UFS host controller driver.
This is used only during development and hence
guarded by CONFIG_UFS_FAULT_INJECTION debug config option.
Signed-
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
I've encountered a race condition which causes the UFS driver to receive
requests with an invalid tag (-1),
and wondering how to go about solving the case.
Consider the following scenario:
1. scsi_request_fn() -> scsi_dispatch_cmd() -> host->hostt->queuecommand()
(mapped to ufshcd_queuecommand)
2
> Please use trace__enabled(), for instance,
> trace_ufshcd_command_enabled().
>
> This also uses jump_labels and is a nop when it is not enabled.
I accept your comment and will fix it.
I'll wait a bit longer with sending v2 in case there are more comments.
Thanks,
Gilad.
--
QUALCOMM ISRAEL, on
Add trace events to driver to allow monitoring and profilig
of activities such as PM suspend/resume, hibernate enter/exit,
clock gating and clock scaling up/down.
In addition, add UFS host controller register dumps to provide
detailed information in case of errors to assist in analysis
of issues.
From: Sujit Reddy Thumma
Use fault-injection framework to simulate error conditions
in the controller and verify error handling mechanisms
implemented in UFS host controller driver.
This is used only during development and hence
guarded by CONFIG_UFS_FAULT_INJECTION debug config option.
Signed-
From: Dolev Raviv
This patch exposes the ioctl interface for UFS driver via SCSI device
ioctl interface. As of now UFS driver would provide the ioctl for query
interface to connected UFS device.
Signed-off-by: Dolev Raviv
Signed-off-by: Noa Rubens
Signed-off-by: Raviv Shvili
Signed-off-by: Ya
- Get/set DME attributes
Signed-off-by: Lee Susman
Signed-off-by: Dolev Raviv
Signed-off-by: Yaniv Gardi
Signed-off-by: Raviv Shvili
Signed-off-by: Gilad Broner
---
drivers/scsi/ufs/Makefile | 1 +
drivers/scsi/ufs/debugfs.c | 898 +
driver
, dump host controller registers and requests descriptors
on failures, several statistics.
Dolev Raviv (1):
scsi: ufs: add ioctl interface for query request
Gilad Broner (1):
scsi: ufs: add trace events and dump prints for debug
Lee Susman (1):
scsi: ufs: add debugfs for ufs
Sujit Reddy
74 matches
Mail list logo