[PATCH] scsi: ufs: Fix Runtime PM

2017-11-13 Thread Michal Potomski
From: Michał Potomski Recent testing of Runtime PM for UFS has shown it's not working as intended. To acheive fully working Runtime PM, first we have to put back scsi_device autopm reference counter. Existing implementation was prone to races and not working for tranfsers to sleeping devices. Th

[PATCH] scsi: ufs: Fix Runtime PM

2017-11-09 Thread Michal Potomski
From: Michał Potomski Recent testing of Runtime PM for UFS has shown it's not working as intended. To acheive fully working Runtime PM, first we have to put back scsi_device autopm reference counter. Existing implementation was prone to races and not working for tranfsers to sleeping devices. Th

[RESEND][PATCH v3 2/2] scsi: ufs: Implement Auto-Hibern8 setup

2017-07-26 Thread Michal Potomski
From: Michał Potomski Since Auto-Hibern8 feature has to be enabled by the user proper API has been given via SysFS. We expose this API to user-space, since we don't know in driver, what kind of additional Power Management rules user wants to use. Due to that we want to expose API, to let user or

[RESEND][PATCH v3 1/2] scsi: ufs: Use DEVICE_ATTR_RW macros and sdev_attrs structure

2017-07-26 Thread Michal Potomski
From: Michał Potomski Previous implementation was obsolete and needed to be updated. Additionally device_create_file() call occurs after a UFS device has been made visible in sysfs and hence will cause trouble (race condition) if a udev rule tries to set this attribute from inside a rule that is

[RESEND][PATCH v3 0/2] UFS SysFS attributes

2017-07-26 Thread Michal Potomski
From: Michał Potomski This patchset implements new SysFS attribute to handle Auto-Hibern8 feature and additionally rewrites present attributes to adhere to new standard. Changes in V3: - rewrite new and present attributes to adhere to DEVICE_ATTR_RW/RO and sdev_attr host template member p

[PATCH v2] scsi: ufs: Implement Auto-Hibern8 setup

2017-07-25 Thread Michal Potomski
From: Michał Potomski Since Auto-Hibern8 feature has to be enabled by the user proper API has been given via SysFS. We expose this API to user-space, since we don't know in driver, what kind of additional Power Management rules user wants to use. Due to that we want to expose API, to let user or

[PATCH] scsi: ufs: Implement Auto-Hibern8 setup

2017-07-25 Thread Michal Potomski
From: Michał Potomski Since Auto-Hibern8 feature has to be enabled by the user proper API has been given via SysFS. We expose this API to user-space, since we don't know in driver, what kind of additional Power Management rules user wants to use. Due to that we want to expose API, to let user or

[PATCH] scsi: ufs: Clean up some rpm/spm level SysFS nodes upon remove

2017-05-11 Thread Michal Potomski
From: Michał Potomski When reloading module these two attributes aren't cleaned up properly and they persist causing warnings when trying to load module again. Additionally they are not recreated properly due to that. Signed-off-by: Michał Potomski --- drivers/scsi/ufs/ufshcd.c | 7 +++ 1

[PATCH v1 0/4] UFS ioctl UAPI

2017-05-11 Thread Michal Potomski
From: Michał Potomski This patchset introduces UFS ioctl UAPI. It's more readable and flexible than its possible SysFS counterpart. Moreover it will be needed for future features, which will require user setup, but are not satified by SysFS "simple types" rule. We have discussed and monitored UF

[PATCH v1 4/4] scsi: ufs: add ioctl interface to read UIC attributes

2017-05-11 Thread Michal Potomski
From: Szymon Mielczarek The interface allows to read both local (Host side) and peer (Device side) UIC attributes using either DME_GET or DME_PEER_GET primitives. The Attribute can be used to determine the current state or the capabilities of the UFS InterConnect Layer (UIC - UniPro & M-PHY). Si

[PATCH v1 1/4] scsi: ufs: Add ioctl() interface with Query Request

2017-05-11 Thread Michal Potomski
From: Michał Potomski Based on unmerged patch: https://patchwork.kernel.org/patch/6435721/ This patch introduces ioctl() API using SCSI ioctl() API for user-space in preparation to wider usage. We came to a conclusion, that ioctl() interface is more convenient and readable for features, that we'

[PATCH v1 3/4] scsi: ufs: Expose Task Management to ioctl() UAPI

2017-05-11 Thread Michal Potomski
From: Michał Potomski Since we already have UFS ioctl() API some additional tools like task management are "nice-to-have" for testing and management purposes. Using this API we can transparently from user perspective query or abort tasks and reset Logical Units. This will help to test all hosts

[PATCH v1 2/4] scsi: ufs: Implement Auto-Hibern8 setup

2017-05-11 Thread Michal Potomski
From: Michał Potomski Since Auto-Hibern8 feature has to be enabled by the user proper API has been given via ioctl() by adding it to already existing implementation of UFS ioctl(). We expose this API to user-space, since we don't know in driver, what kind of additional Power Management rules use