Re: [PATCH v2 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-08-21 Thread Akinobu Mita
2015-08-20 22:59 GMT+09:00 Yaniv Gardi yga...@codeaurora.org: +static bool ufs_qcom_testbus_cfg_is_ok(struct ufs_qcom_host *host) +{ + if (host-testbus.select_major = TSTBUS_MAX) { + dev_err(host-hba-dev, + %s: UFS_CFG1[TEST_BUS_SEL} may not equal

IO failures with SMR drives at latest kernel versions

2015-08-21 Thread Anatol Pomozov
Hi I recently got 2 Seagate 8Tb drives. 'dd' over whole disc ran fine. Then I inserted into my RAID and started rebalancing. I've got following error almost immediately: ata5.00: failed command: WRITE FPDMA QUEUED ata5.00: cmd 61/00:e0:80:e7:75/1d:00:9f:00:00/40 tag 28 ncq 3801088 out

Re: [patch] mptfusion: prevent some memory corruption

2015-08-21 Thread Dan Carpenter
Ping? regards, dan carpenter On Fri, Jul 03, 2015 at 11:53:03AM +0300, Dan Carpenter wrote: These are signed values the come from the user, we put a cap on the upper bounds but not on the lower bounds. We use karg.dataSgeOffset to calculate sz. We verify sz and proceed as if that means

[PATCH v1 08/15] scsi: ufs: add retries to dme_peer get and set attribute

2015-08-21 Thread Yaniv Gardi
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 command will be sent. Signed-off-by: Yaniv Gardi

[PATCH v1 11/15] scsi: ufs: retry failed query flag requests

2015-08-21 Thread Yaniv Gardi
UFS flag query requests may fail sometimes due to timeouts etc. Add a wrapper function to retry up to 10 times in case of such failure, similar to retries being made for attribute queries. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 63

[PATCH v1 10/15] scsi: ufs: fix error recovery after the hibern8 exit failure

2015-08-21 Thread Yaniv Gardi
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 startup but this recovery mechanism results into deadlock or errors

[PATCH v1 09/15] scsi: ufs: add retries for hibern8 enter

2015-08-21 Thread Yaniv Gardi
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. Recovers the UFS link to active state 2. If link is

Re: [PATCH v2 7/8] scsi: ufs-qcom: add debug prints for test bus

2015-08-21 Thread ygardi
2015-08-20 22:59 GMT+09:00 Yaniv Gardi yga...@codeaurora.org: @@ -30,6 +48,14 @@ static void ufs_qcom_get_speed_mode(struct ufs_pa_layer_attr *p, char *result); static int ufs_qcom_get_bus_vote(struct ufs_qcom_host *host, const char *speed_mode); static int

[PATCH v1 00/15] Big fixes, retries, handle a race condition

2015-08-21 Thread Yaniv Gardi
This serie of 15 small patches should be pushed after the series of 8 patches I have uploaded to the upstream a week ago: Fix error message and present UFS variant probe Yaniv Gardi (15): scsi: ufs: clear UTRD, UPIU req and rsp before new transfers scsi: ufs: clear fields UTRD, UPIU req and

[PATCH v1 03/15] scsi: ufs: verify command tag validity

2015-08-21 Thread Yaniv Gardi
A race condition appear to exist between request completion when scsi_done() is called to end the request and set the tag back to -1 (at blk_queue_end_tag() scsi_end_request), and scsi layer error handling which aborts the command and reuses it to request sense data. Sending the request sense is

[PATCH v1 05/15] scsi: ufs: increase fDeviceInit query response timeout

2015-08-21 Thread Yaniv Gardi
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 600ms. Without this change, we might unnecessarily

[PATCH v1 01/15] scsi: ufs: clear UTRD, UPIU req and rsp before new transfers

2015-08-21 Thread Yaniv Gardi
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 the SCSI command size. As different SCSI commands differ in size

[PATCH v1 07/15] scsi: ufs: set REQUEST_SENSE command size to 18 bytes

2015-08-21 Thread Yaniv Gardi
According to UFS device specification REQUEST_SENSE command can only report back up to 18 bytes of data. Signed-off-by: Yaniv Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c

[PATCH v1 06/15] scsi: ufs: avoid exception event handler racing with PM callbacks

2015-08-21 Thread Yaniv Gardi
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 issue by not scheduling the exception event handler

[PATCH v1 04/15] scsi: ufs: clear outstanding_request bit in case query timeout

2015-08-21 Thread Yaniv Gardi
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 Gardi yga...@codeaurora.org --- drivers/scsi/ufs/ufshcd.c | 22

[PATCH v1 02/15] scsi: ufs: clear fields UTRD, UPIU req and rsp before new transfers

2015-08-21 Thread Yaniv Gardi
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 and NOP command before sending out the command. We also initialize

[PATCH v1 15/15] scsi: ufs: add wrapper for retrying sending query attribute

2015-08-21 Thread Yaniv Gardi
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, or before reporting a failure. Signed-off-by: Yaniv

[PATCH v1 12/15] scsi: ufs: reduce the interrupts for power mode change requests

2015-08-21 Thread Yaniv Gardi
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 both of these completions are registered as interrupt

[PATCH v1 13/15] scsi: ufs: add missing memory barriers

2015-08-21 Thread Yaniv Gardi
Performing several writes to UFS host controller registers has no gurrantee of ordering, so we must make sure register writes to setup request list base address etc. are performed before the run/stop register is enabled. In addition, when setting up a task request, we must make sure the updating

Re: [PATCH v2 6/8] scsi: ufs: make the UFS variant a platform device

2015-08-21 Thread ygardi
2015-08-20 22:59 GMT+09:00 Yaniv Gardi yga...@codeaurora.org: @@ -1036,7 +1037,7 @@ void ufs_qcom_clk_scale_notify(struct ufs_hba *hba) * The variant operations configure the necessary controller and PHY * handshake during initialization. */ -static const struct ufs_hba_variant_ops

Vorteile

2015-08-21 Thread email
Ich habe eine positive Sache für uns beide. Sie sollten mit mir unter der E-Mail-Adresse ein für Erklärungen zu antworten. E-Mail: chn.j...@gmail.com -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo

[PATCH 01/10] phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com This patch introduces Exynos UFS PHY driver. This driver supports to deal with phy calibration and power control according to UFS host driver's behavior. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com

[PATCH 05/10] scsi: ufs: add quirk to enable host controller without hce

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com Some host controller doesn't support host controller enable via HCE. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com --- drivers/scsi/ufs/ufshcd.c | 76 +++--

[PATCH 09/10] scsi: ufs: return value of pwr_change_notify

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com Behavior of the powwer mode change contains vendor specific operation known as pwr_change_notify. This change adds return for pwr_change_notify to find success or failure. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar

[PATCH 06/10] scsi: ufs: add specific callback for nexus type

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com Some host controller needs nexus type information for handling command. This change adds specific callback function to support vendor's implementation. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com

[PATCH 03/10] scsi: ufs: add quirk to fix mishandling utrlclr/utmrlclr

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com In the right behavior, setting the bit to '0' indicates clear and '1' indicates no change. If host contoller handles this the other way, UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR can be used. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim

[PATCH 04/10] scsi: ufs: add quirk not to allow reset of interrupt aggregation

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com Some host controller supports interrupt aggregation, but doesn't allow to reset counter and timer by s/w. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com --- drivers/scsi/ufs/ufshcd.c |3 ++-

[PATCH 10/10] scsi: ufs-exynos: add UFS host support for Exynos SoCs

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com This patch introduces Exynos UFS host controller driver, which mainly handles vendor-specific operations including link startup, power mode change and hibernation/unhibernation. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar

[PATCH 00/10] exynos-ufs: add support for Exynos

2015-08-21 Thread Alim Akhtar
This patch-set introduces UFS (Universal Flash Storage) host support for Samsung Exynos SoC. Mostly, it consists of UFS PHY and host specific driver. And it also contains some quirks handling for Exynos. Seungwon Jeon (10): phy: exynos-ufs: add UFS PHY driver for EXYNOS SoC scsi: ufs: add

[PATCH 02/10] scsi: ufs: add quirk to contain unconformable utrd field

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com UTRD(UTP Transfer Request Descriptor)'s field such as offset/length, especially response's has DWORD expression. This quirk can be specified for host controller not to conform standard. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim

[PATCH 07/10] scsi: ufs: add add specific callback for hibern8

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com Some host controller needs specific handling before/after (un)hibernation, This change adds specific callback function to support vendor's implementation. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com

[PATCH 08/10] scsi: ufs: make ufshcd_config_pwr_mode of non-static func

2015-08-21 Thread Alim Akhtar
From: Seungwon Jeon tgih@samsung.com It can be used in the vendor's driver for the specific purpose. Signed-off-by: Seungwon Jeon tgih@samsung.com Signed-off-by: Alim Akhtar alim.akh...@samsung.com --- drivers/scsi/ufs/ufshcd.c |5 ++--- drivers/scsi/ufs/ufshcd.h |2 ++ 2 files