[PATCH] scsi: ufs: revamp string descriptor reading

2018-12-11 Thread Tomas Winkler
Define new a type: uc_string_id for easier string handling and less casting. Reduce number or string copies in price of a dynamic allocation. Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufs-sysfs.c | 20 ++--- drivers/scsi/ufs/ufs.h | 2 +- drivers/scsi/ufs/ufshcd.c| 164

[PATCH] scsi: ufs: add fall through annotation

2018-11-26 Thread Tomas Winkler
Add /* fallthrough */ annotation, to eliminate compilation warning: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH] scsi: ufs: ufshcd_dump_regs to use memcpy_fromio

2018-03-06 Thread Tomas Winkler
/ufshcd.c:356:9:expected void const *buf drivers/scsi/ufs/ufshcd.c:356:9:got void [noderef] *mmio_base Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufs-qcom.c | 21 ++--- drivers/scsi/ufs/ufshcd.c | 35 --- drivers/scsi/ufs/ufshcd.h

[scsi] scsi: ufshcd-platform: remove the useless cast in ERR_PTR/IS_ERR

2017-03-14 Thread Tomas Winkler
IS_ERR and ERR_PTR already forcefully cast their argument, hence there is no need for additional (complex) casting. Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd-pltfrm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b

[scsi] scsi: ufs: don't check unsigned type for a negative value

2017-03-12 Thread Tomas Winkler
Fix compilation warning drivers/scsi/ufs/ufshcd.c:7645:13: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] if ((value < UFS_PM_LVL_0) || (value >= UFS_PM_LVL_MAX)) Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1

[scsi 4/4] scsi: ufs: refactor device descriptor reading

2017-01-04 Thread Tomas Winkler
-by: Tomas Winkler --- drivers/scsi/ufs/ufs.h| 12 drivers/scsi/ufs/ufs_quirks.h | 28 ++-- drivers/scsi/ufs/ufshcd.c | 40 +++- 3 files changed, 37 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/ufs

[scsi 1/4] scsi: ufs: ufshcd_query_descriptor_retry should be static

2017-01-04 Thread Tomas Winkler
Fix the following compilation warning: drivers/scsi/ufs/ufshcd.c:2076:5: warning: no previous prototype for ‘ufshcd_query_descriptor_retry’ [-Wmissing-prototypes] Also do not export the function, it should not be used out of ufs context. Signed-off-by: Tomas Winkler --- drivers/scsi/ufs

[scsi 2/4] scsi: ufs: unexport descritpor reading functions

2017-01-04 Thread Tomas Winkler
Unexport ufshcd_read_device_desc and ufshcd_read_string_desc there is no really possibility to calling them directly outside of UFS context. Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 9 - drivers/scsi/ufs/ufshcd.h | 7 --- 2 files changed, 4 insertions(+), 12

[scsi 3/4] scsi: ufs: ufshcd_get_max_icc_level fix endianity handling

2017-01-04 Thread Tomas Winkler
Reading big endian value from a buffer requires explicit cast. Fix sparse warning: drivers/scsi/ufs/ufshcd.c:4825:24: warning: cast to restricted __be16 Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi

[PATCH v7 03/11] rpmb: add sysfs-class ABI documentation

2016-11-07 Thread Tomas Winkler
V2: resend V3: add more verbose description V4: resend V5: adjust date and kernel version V6: adjust date and kernel version V7: adjust date and kernel version Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs-class-rpmb | 20 MAINTAINERS

[PATCH v7 00/11] char:rpmb: Replay Protected Memory Block (RPMB) subsystem

2016-11-07 Thread Tomas Winkler
Documentation 4. Addional small fixes described in individual patches. Tomas Winkler (11): rpmb: add Replay Protected Memory Block (RPMB) subsystem rpmb: enable emmc specific read data fixup rpmb: add sysfs-class ABI documentation char: rpmb: add device attributes char: rpmb: provide a user

[PATCH v7 01/11] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-11-07 Thread Tomas Winkler
short workflow description in the commit message V3: commit message fix V4: resend V5: add rpmb sequence interface. V6: 1. More info in the commit message 2. Define simulation device type V7: resend Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- MAINTAINERS

[PATCH v7 02/11] rpmb: enable emmc specific read data fixup

2016-11-07 Thread Tomas Winkler
For eMMC the block count of the RPMB read operation is not indicated in the original RPMB Data Read Request packet. This might be different then the implementation of other protocol standards. This patch implements a fixup for this behavior. V6: new in the series V7: resend Signed-off-by: Tomas

[PATCH v7 06/11] char: rpmb: add RPMB simulation device

2016-11-07 Thread Tomas Winkler
dress should be set in the result frame. 4. Remove platform device 5. Update the commit message V7: Resend. Signed-off-by: Tomas Winkler --- drivers/char/rpmb/Kconfig| 17 + drivers/char/rpmb/Makefile | 1 + drivers/char/rpmb/rpmb_sim.c

[PATCH v7 05/11] char: rpmb: provide a user space interface

2016-11-07 Thread Tomas Winkler
pointer. 2. Fix possible macro side-effect due to macro argument reuse. Signed-off-by: Tomas Winkler --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 1 + drivers/char/rpmb/Kconfig| 7 + drivers/char/rpmb/Makefile | 1 + drivers

[PATCH v7 04/11] char: rpmb: add device attributes

2016-11-07 Thread Tomas Winkler
Maj V5: update date and kernel version V6: 1. Add simulation device type 2. Update date and kernel version 3. Use binary attribute for id 4. use simple sprintf instead of scnprintf 5. Add more verbose documenation V7: resend Signed-off-by: Tomas Winkler --- Documentation/ABI

[PATCH v7 11/11] char: rpmb: Document Replay Protected Memory Block (RPMB) subsystem

2016-11-07 Thread Tomas Winkler
Add rpmb documentatin in sphinx format. V7: new in the series Signed-off-by: Tomas Winkler --- Documentation/index.rst | 1 + Documentation/rpmb/conf.py | 5 ++ Documentation/rpmb/index.rst | 18 ++ Documentation/rpmb/introduction.rst

[PATCH v7 09/11] scsi: ufs: connect to RPMB subsystem

2016-11-07 Thread Tomas Winkler
commands. V2: resend V3: resend V4: Kconfig: use select RPMB to ensure valid configuration V5: Revamp code using new sequence command. V6: Resend V7: Resend Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/Kconfig | 1 + drivers/scsi/ufs/ufshcd.c | 183

[PATCH v7 10/11] scsi: ufs: retrieve rpmb rw size

2016-11-07 Thread Tomas Winkler
Retrieve maximum number of RPMB frames that can be in a single request. Currently the limitations is provided only for writes via reliable_wr_cnt API. V7: New in the series Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/scsi/ufs/ufs.h| 6 ++ drivers/scsi

[PATCH v7 08/11] mmc: block: register RPMB partition with the RPMB subsystem

2016-11-07 Thread Tomas Winkler
: Revamp code using new sequence command Support for 8K packets in e.MMC v5.1 V6: Resend. V7: Resend. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/mmc/card/Kconfig | 1 + drivers/mmc/card/block.c | 258 ++- 2 files changed

[PATCH v7 07/11] tools rpmb: add RPBM access tool

2016-11-07 Thread Tomas Winkler
instead of macro for rw blocking wrapper Signed-off-by: Tomas Winkler --- MAINTAINERS |1 + tools/Makefile| 14 +- tools/rpmb/.gitignore |2 + tools/rpmb/Makefile | 34 ++ tools/rpmb/rpmb.c | 1035 + 5 files changed

[PATCH v6 2/9] rpmb: enable emmc specific read data fixup

2016-09-13 Thread Tomas Winkler
For eMMC the block count of the RPMB read operation is not indicated in the original RPMB Data Read Request packet. This might be different then the implementation of other protocol standards. This patch implements a fixup for this behavior. Signed-off-by: Tomas Winkler --- V6: new in the

[PATCH v6 8/9] mmc: block: register RPMB partition with the RPMB subsystem

2016-09-13 Thread Tomas Winkler
Register eMMC RPMB partition with the RPMB subsystem and provide implementation for the RPMB access operations abstracting actual multi step process. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: resend V3: commit message fix V4: Kconfig: use select RPMB to ensure valid

[PATCH v6 7/9] tools rpmb: add RPBM access tool

2016-09-13 Thread Tomas Winkler
Add simple RPMB host testing tool. It can be used to program key, write and read data block, and retrieve write counter. Signed-off-by: Tomas Winkler --- V2: resend V3: fix missing objtool V4: add verbose option V5: 1. Adjust to the new API. 2. Exercise both request and sequence ioctls. V6

[PATCH v6 1/9] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-09-13 Thread Tomas Winkler
-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: added short workflow description in the commit message V3: commit message fix V4: resend V5: add rpmb sequence interface. V6: 1. More info in the commit message 2. Define simulation device type MAINTAINERS| 7

[PATCH v6 9/9] scsi: ufs: connect to RPMB subsystem

2016-09-13 Thread Tomas Winkler
commands. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- V2: resend V3: resend V4: Kconfig: use select RPMB to ensure valid configuration V5: Revamp code using new sequence command. V5: resend drivers/scsi/ufs/Kconfig | 1 + drivers/scsi/ufs/ufshcd.c | 183

[PATCH v6 5/9] char: rpmb: provide a user space interface

2016-09-13 Thread Tomas Winkler
for easier adjusting of the applications that use MMC_IOC_MULTI_CMD ioctl. Signed-off-by: Tomas Winkler --- V2: use memdup_user V3: commit message fix V4: resend V5: 1. Add RPMB_IOC_SEQ_CMD API. 2. Export uapi rpmb.h header V6: 1. remove #include 2. Add ioctl documentation Documentation

[PATCH v6 3/9] rpmb: add sysfs-class ABI documentation

2016-09-13 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- V2: resend V3: add more verbose description V4: resend V5: adjust date and kernel version V6: adjust date and kernel version Documentation/ABI/testing/sysfs-class-rpmb | 20 MAINTAINERS| 1 + 2 files changed

[PATCH v6 4/9] char: rpmb: add device attributes

2016-09-13 Thread Tomas Winkler
Add attribute type that displays underlay storage type technology EMMC, UFS, and attribute id, that displays underlay storage device id. For EMMC this would be content of CID and for UFS serial number from the device descriptor. Signed-off-by: Tomas Winkler --- V2: resend V3: set kernel version

[PATCH v6 6/9] char: rpmb: add RPMB simulation device

2016-09-13 Thread Tomas Winkler
dress should be set in the result frame. 4. Remove platform device 5. Update the commit message Signed-off-by: Tomas Winkler --- drivers/char/rpmb/Kconfig| 17 + drivers/char/rpmb/Makefile | 1 + drivers/char/rpmb/rpmb_sim.c | 744 +++ 3

[PATCH v6 0/9] Replay Protected Memory Block (RPMB) subsystem

2016-09-13 Thread Tomas Winkler
/ directory that exercises these interfaces and a simulation device that implements the device part. The code is also available from: https://github.com/tomasbw/linux-mei.git rpmb Tomas Winkler (9): rpmb: add Replay Protected Memory Block (RPMB) subsystem rpmb: enable emmc specific read data

[PATCH v5 8/8] scsi: ufs: connect to RPMB subsystem

2016-07-18 Thread Tomas Winkler
commands. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- V2: resend V3: resend V4: Kconfig: use select RPMB to ensure valid configuration V5: Revamp code using new sequence command. drivers/scsi/ufs/Kconfig | 1 + drivers/scsi/ufs/ufshcd.c | 183

[PATCH v5 7/8] mmc: block: register RPMB partition with the RPMB subsystem

2016-07-18 Thread Tomas Winkler
Register eMMC RPMB partition with the RPMB subsystem and provide implementation for the RPMB access operations abstracting actual multi step process. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: resend V3: commit message fix V4: Kconfig: use select RPMB to ensure valid

[PATCH v5 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-07-18 Thread Tomas Winkler
interfaces and a simulation device that implements the device part. Tomas Winkler (8): rpmb: add Replay Protected Memory Block (RPMB) subsystem char: rpmb: add sysfs-class ABI documentation char: rpmb: add device attributes char: rpmb: provide a user space interface char: rpmb: add RPMB

[PATCH v5 2/8] char: rpmb: add sysfs-class ABI documentation

2016-07-18 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- V2: resend V3: add more verbose description V4: resend V5: adjust date and kernel version Documentation/ABI/testing/sysfs-class-rpmb | 20 MAINTAINERS| 1 + 2 files changed, 21 insertions(+) create mode

[PATCH v5 6/8] tools rpmb: add RPBM access tool

2016-07-18 Thread Tomas Winkler
Add simple RPMB host testing tool. It can be used to program key, write and read data block, and retrieve write counter. Signed-off-by: Tomas Winkler --- V2: resend V3: fix missing objtool V4: add verbose option V5: 1. Adjust to the new API. 2. Exercise both request and sequence ioctls

[PATCH v5 5/8] char: rpmb: add RPMB simulation device

2016-07-18 Thread Tomas Winkler
This is a simple platform device used for testing the RPMB subsystem. The module currently supports two configuration options: 1. max_wr_blks: for specifying max blocks that can be written in a single command 2. daunits: used to set storage capacity in 128K units. Signed-off-by: Tomas Winkler

[PATCH v5 4/8] char: rpmb: provide a user space interface

2016-07-18 Thread Tomas Winkler
for easier adjusting of the applications that use MMC_IOC_MULTI_CMD ioctl. Signed-off-by: Tomas Winkler --- V2: use memdup_user V3: commit message fix V4: resend V5: 1. Add RPMB_IOC_SEQ_CMD API. 2. Export uapi rpmb.h header Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS

[PATCH v5 3/8] char: rpmb: add device attributes

2016-07-18 Thread Tomas Winkler
Add attribute type that displays underlay storage type technology EMMC, UFS, and attribute id, that displays underlay storage device id. For EMMC this would be content of CID and for UFS serial number from the device descriptor. Signed-off-by: Tomas Winkler --- V2: resend V3: set kernel version

[PATCH v5 1/8] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-07-18 Thread Tomas Winkler
enables sending sequence of RPMB standard frames. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: added short workflow description in the commit message V3: commit message fix V4: resend V5: add rpmb sequence interface. MAINTAINERS| 7 + drivers/char

Re: [PATCH v2] byteswap: try to avoid __builtin_constant_p gcc bug

2016-06-22 Thread Tomas Winkler
On Wed, Jun 22, 2016 at 3:25 PM, Arnd Bergmann wrote: > On Wednesday, June 22, 2016 2:44:21 PM CEST Tomas Winkler wrote: >> > >> > There are more than 20 files that have the statement: case cpu_to_... >> > Sparse complains about: case __builtin_bswap, not ab

Re: [PATCH v2] byteswap: try to avoid __builtin_constant_p gcc bug

2016-06-22 Thread Tomas Winkler
On Wed, Jun 22, 2016 at 1:25 PM, Levy, Amir (Jer) wrote: > On 2016-06-22 Arnd Bergmann wrote: >> On Wednesday, June 22, 2016 11:24:50 AM CEST Tomas Winkler wrote: >> > On Tue, Jun 21, 2016 at 12:02 PM, Tomas Winkler >> wrote: >> > > On Tue, May 3, 2016

Re: [PATCH v2] byteswap: try to avoid __builtin_constant_p gcc bug

2016-06-22 Thread Tomas Winkler
On Tue, Jun 21, 2016 at 12:02 PM, Tomas Winkler wrote: > On Tue, May 3, 2016 at 9:36 AM, Arnd Bergmann wrote: >> On Monday 02 May 2016 16:32:25 Andrew Morton wrote: >>> On Tue, 03 May 2016 01:10:16 +0200 Arnd Bergmann wrote: >>> >>> > On Monday 0

Re: [PATCH v2] byteswap: try to avoid __builtin_constant_p gcc bug

2016-06-21 Thread Tomas Winkler
On Tue, May 3, 2016 at 9:36 AM, Arnd Bergmann wrote: > On Monday 02 May 2016 16:32:25 Andrew Morton wrote: >> On Tue, 03 May 2016 01:10:16 +0200 Arnd Bergmann wrote: >> >> > On Monday 02 May 2016 16:02:18 Andrew Morton wrote: >> > > On Mon, 02 May 2016 23:48:19 +0200 Arnd Bergmann wrote: >> > >

[PATCH v4 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-06-01 Thread Tomas Winkler
IOCTL command similar to the one provided by mmc/ioctl. h This API may help applications such as https://android.googlesource.com/trusty/app/storage/ To be obliviose to the underlaying HW storage technology. There is a sample tool under tools/rpmb/ directory that exercises this interface. Tomas

[PATCH v4 1/8] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-06-01 Thread Tomas Winkler
W-LUN (UFS) with the RPMB layer providing an implementation for send_rpmb_req() handler. V2: added short workflow description in the commit message V3: commit message fix V4: resend Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- MAINTAINERS| 7 + drivers

[PATCH v4 4/8] char: rpmb: provide user space interface

2016-06-01 Thread Tomas Winkler
The user space API is achieved via single synchronous IOCTL. The request is submitted in in_frames_ptr pointer and received in out_frames_ptr. V2: use memdup_user V3: commit message fix V4: resend Signed-off-by: Tomas Winkler --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS

[PATCH v4 5/8] char: rpmb: add RPMB simulation device

2016-06-01 Thread Tomas Winkler
is set automatically V3: 1. Add shutdown handler (similar to ufshcd) 2. Commit message fix V4: use select RPMB to ensure valid configuration Signed-off-by: Tomas Winkler --- drivers/char/rpmb/Kconfig| 10 + drivers/char/rpmb/Makefile | 1 + drivers/char/rpmb/rpmb_sim.c | 589

[PATCH v4 3/8] char: rpmb: add device attributes

2016-06-01 Thread Tomas Winkler
version to 4.8 Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs-class-rpmb | 24 +++ drivers/char/rpmb/core.c | 64 ++ 2 files changed, 88 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-rpmb b/Documentation/ABI

[PATCH v4 2/8] char: rpmb: add sysfs-class ABI documentation

2016-06-01 Thread Tomas Winkler
V2: resend V3: add more verbose description V4: update kernel version to 4.8 Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs-class-rpmb | 20 MAINTAINERS| 1 + 2 files changed, 21 insertions(+) create mode 100644

[PATCH v4 6/8] tools rpmb: add RPBM access tool

2016-06-01 Thread Tomas Winkler
Add simple RPMB host testing tool. It can be used to program key, write and read data block, and retrieve write counter. V2: resend V3: fix missing objtool V4: add verbose option Signed-off-by: Tomas Winkler --- MAINTAINERS | 1 + tools/Makefile| 14 +- tools/rpmb

[PATCH v4 7/8] mmc: block: register RPMB partition with the RPMB subsystem

2016-06-01 Thread Tomas Winkler
-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/mmc/card/Kconfig | 1 + drivers/mmc/card/block.c | 292 +++ 2 files changed, 293 insertions(+) diff --git a/drivers/mmc/card/Kconfig b/drivers/mmc/card/Kconfig index 5562308699bc

[PATCH v4 8/8] scsi: ufs: connect to RPMB subsystem

2016-06-01 Thread Tomas Winkler
commands. V2: resend V3: resend V4: Kconfig: use select RPMB to ensure valid configuration Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/Kconfig | 1 + drivers/scsi/ufs/ufshcd.c | 219 ++ drivers/scsi/ufs/ufshcd.h

[PATCH fix for v4.6] scsi: ufs: make ufshcd_query_descriptor_retry static

2016-04-04 Thread Tomas Winkler
;scsi: ufs: add retry for query descriptors")' Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index f8fa72c31a9d..629140c11be6 100644 --- a/drivers/sc

[PATCH v2 2/8] char: rpmb: add sysfs-class ABI documentation

2016-04-04 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- V2: resend Documentation/ABI/testing/sysfs-class-rpmb | 15 +++ MAINTAINERS| 1 + 2 files changed, 16 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-rpmb diff --git a/Documentation/ABI/testing

[PATCH v2 1/8] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-04-04 Thread Tomas Winkler
(ufs) with the RPMB layer providing an implementation for send_rpmb_req() handler. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: added short workflow description in the commit message MAINTAINERS| 7 + drivers/char/Kconfig | 2 + drivers/char

[PATCH v2 3/8] char: rpmb: add device attributes

2016-04-04 Thread Tomas Winkler
Add attribute type that displays underlay storage type technology EMMC, UFS, and attribute id, that displays underlay storage device id. For EMMC this would be content of CID and for UFS serial number from the device descriptor Signed-off-by: Tomas Winkler --- V2: resend Documentation/ABI

[PATCH v2 4/8] char: rpmb: provide user space interface

2016-04-04 Thread Tomas Winkler
The user space API is achieved via single synchronous IOCTL. The request is submitted in_frames_ptr pointer and received in out_frames_ptr. Signed-off-by: Tomas Winkler --- V2: use memdup_user Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 1 + drivers

[PATCH v2 7/8] mmc: block: register rpmb partition with the RPMB subsystem

2016-04-04 Thread Tomas Winkler
Register eMMC rpmb partition with the rpmb subsystem and provide implementation for the RPMB access operations abstracting actual multi step process. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- V2: resend drivers/mmc/card/block.c | 289

[PATCH v2 6/8] tools rpmb: add RPBM access tool

2016-04-04 Thread Tomas Winkler
Add simple RPMB host testing tool. It can be used to program key, write and read data block, and retrieve write counter. Signed-off-by: Tomas Winkler --- V2: resend MAINTAINERS | 1 + tools/Makefile| 16 +- tools/rpmb/.gitignore | 2 + tools/rpmb/Makefile | 32

[PATCH v2 5/8] char: rpmb: add RPMB simulation device

2016-04-04 Thread Tomas Winkler
This is simple platform device for used for testing rpmb subystem. The module currently suppot two configuration options 1.max_wr_blks: for specifying max blocks that can be written in a single command and. 2. daunits: used to set storage capacity in 128K units. Signed-off-by: Tomas Winkler

[PATCH v2 8/8] scsi: ufs: connect to RPMB subsystem

2016-04-04 Thread Tomas Winkler
commands. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- V2: resend drivers/scsi/ufs/ufshcd.c | 219 ++ drivers/scsi/ufs/ufshcd.h | 2 + 2 files changed, 221 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs

[PATCH 0/8 V2] Replay Protected Memory Block (RPMB) subsystem

2016-04-04 Thread Tomas Winkler
IOCTL command similar to the one provided by mmc/ioctl. h There is a sample tool under tools/rpmb/ directory that exercises this interface. Tomas Winkler (8): rpmb: add Replay Protected Memory Block (RPMB) subsystem char: rpmb: add sysfs-class ABI documentation char: rpmb: add device attributes

[PATCH 3/8] char: rpmb: add device attributes

2016-04-03 Thread Tomas Winkler
Add attribute type that displays underlay storage type technology EMMC, UFS, and attribute id, that displays underlay storage device id. For EMMC this would be content of CID and for UFS serial number from the device descriptor Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs

[PATCH 7/8] mmc: block: register rpmb partition with the RPMB subsystem

2016-04-03 Thread Tomas Winkler
Register eMMC rpmb partition with the rpmb subsystem and provide implementation for the RPMB access operations abstracting actual multi step process. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/mmc/card/block.c | 289

[PATCH 6/8] tools rpmb: add RPBM access tool

2016-04-03 Thread Tomas Winkler
Add simple RPMB host testing tool. It can be used to program key, write and read data block, and retrieve write counter. Signed-off-by: Tomas Winkler --- MAINTAINERS | 1 + tools/Makefile| 16 +- tools/rpmb/.gitignore | 2 + tools/rpmb/Makefile | 32 ++ tools/rpmb

[PATCH 0/8] Replay Protected Memory Block (RPMB) subsystem

2016-04-03 Thread Tomas Winkler
class_interface_register (). A parallel user space API is provided via /dev/rpmbX character device with a single IOCTL command similar to the one provided by mmc/ioctl. h There is a sample tool under tools/rpmb/ directory that exercises this interface. Tomas Winkler (8): rpmb: add Replay Protected Memory Block (RPMB

[PATCH 4/8] char: rpmb: provide user space interface

2016-04-03 Thread Tomas Winkler
The user space API is achieved via single synchronous IOCTL. The request is submitted in_frames_ptr pointer and received in out_frames_ptr. Signed-off-by: Tomas Winkler --- Documentation/ioctl/ioctl-number.txt | 1 + MAINTAINERS | 1 + drivers/char/rpmb/Kconfig

[PATCH 2/8] char: rpmb: add sysfs-class ABI documentation

2016-04-03 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- Documentation/ABI/testing/sysfs-class-rpmb | 15 +++ MAINTAINERS| 1 + 2 files changed, 16 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-class-rpmb diff --git a/Documentation/ABI/testing/sysfs

[PATCH 8/8] scsi: ufs: connect to RPMB subsystem

2016-04-03 Thread Tomas Winkler
commands. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 219 ++ drivers/scsi/ufs/ufshcd.h | 2 + 2 files changed, 221 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index

[PATCH 1/8] rpmb: add Replay Protected Memory Block (RPMB) subsystem

2016-04-03 Thread Tomas Winkler
class_interface_register (). A storage device registers its RPMB hardware (emmc) partition or RPMB W-LUN (ufs) with the RPMB layer providing an implementation for send_rpmb_req() handler. Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- MAINTAINERS| 7 + drivers/char

[PATCH 5/8] char: rpmb: add RPMB simulation device

2016-04-03 Thread Tomas Winkler
This is simple platform device for used for testing rpmb subystem. The module currently suppot two configuration options 1.max_wr_blks: for specifying max blocks that can be written in a single command and. 2. daunits: used to set storage capacity in 128K units. Signed-off-by: Tomas Winkler

[scsi 1/2] ufs: fix typo: MAZ to MAX

2016-02-09 Thread Tomas Winkler
QUERY_DESC_GEOMETRY_MAZ_SIZE QUERY_DESC_GEOMETRY_MAX_SIZE Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufs.h| 2 +- drivers/scsi/ufs/ufshcd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/ufs/ufs.h b/drivers/scsi/ufs/ufs.h index 42c459a9d3fe

[scsi 2/2] scsi: ufs: fix few typos in the comments

2016-02-09 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- drivers/scsi/ufs/ufshcd.c | 4 ++-- drivers/scsi/ufs/ufshcd.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index a44153401aee..07f1fa438fec 100644 --- a/drivers/scsi/ufs/ufshcd.c

[scsi 2/7 RESEND] scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS;

2015-07-28 Thread Tomas Winkler
use SCSI_W_LUN_REPORT_LUNS from scsi.h instead of localy defined SAM2_WLUN_REPORT_LUNS Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi

[scsi 3/7 RESEND] scsi_debug: vfree is null safe so drop the check

2015-07-28 Thread Tomas Winkler
Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index bbe04dae040c..e2c509e39765 100644 --- a/drivers/scsi/scsi_debug.c +++ b

[scsi 6/7 RESEND] scsi_debug: fix REPORT LUNS Well Known LU

2015-07-28 Thread Tomas Winkler
The use case to report 'REPORT LUNS WLUN' described in scsi_debug documentation didn't work because: scsi_scan_host_selected() checks for: lun < shost->max_lun To fix this we set: max_lun = SCSI_W_LUN_REPORT_LUNS + 1; Signed-off-by: Tomas Winkler Acke

[scsi 5/7 RESEND] scsi_debug: schedule_resp fix input variable check

2015-07-28 Thread Tomas Winkler
The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Cc: Douglas Gilbert Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 13 ++

[scsi 1/7 RESEND] scsi_debug: define pr_fmt() for consistent logging

2015-07-28 Thread Tomas Winkler
Use pr_fmt with both module name and __func__ Also drop few bare printk leftovers The log format should stay pretty much intact Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 118 +- 1 file changed, 53

[scsi 4/7 RESEND] scsi_debug: make dump_sector static

2015-07-28 Thread Tomas Winkler
fixes warning: warning: no previous prototype for ‘dump_sector’ Signed-off-by: Tomas Winkler Acked-by: Douglas Gilbert --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index e2c509e39765

[scsi 7/7] scsi_debug: resp_request: remove unused variable

2015-07-28 Thread Tomas Winkler
Fixes the following warning In function ‘resp_requests’: drivers/scsi//scsi_debug.c:1432:15: warning: variable ‘want_dsense’ set but not used [-Wunused-but-set-variable] bool dsense, want_dsense; Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 3 +-- 1 file changed, 1 insertion

[scsi 1/2] scsi_debug: enable adding more WLUNs

2015-03-01 Thread Tomas Winkler
To add wlun during probe, call sdebug_register_w_lun(WLUN); prior to setting max luns hpnt->max_lun = sdebug_max_luns(); Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 105 -- 1 file changed, 82 insertions(+),

[scsi 2/2] scsi_debug: add UFS WLUNs

2015-03-01 Thread Tomas Winkler
Add ufs wluns: ufs, boot, and rpmb enabled by boolean ufs module parameter. Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 5d1bb12adc43

[scsi 2/2] scsi_debug: use scsi_device_get_hdata

2015-03-01 Thread Tomas Winkler
Cc: Christoph Hellwig Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 079934c8698e..0825c0a62a33 100644

[scsi 1/2] scsi device: add setters and getters for hostadat

2015-03-01 Thread Tomas Winkler
Add setters and getters for host data of scsi_device and scsi_target in spirit of dev_set/get_drvdata Cc: Christoph Hellwig Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- include/scsi/scsi_device.h | 21 + 1 file changed, 21 insertions(+) diff --git a/include/scsi

[PATH V2] scsi_debug: rework resp_report_luns

2015-02-25 Thread Tomas Winkler
1. Remove duplicated boundary checks which simplify the fill-in loop 2. Use more of scsi generic API Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- V2: keep alloc_len < 4 as required by SPC-4 and newer drivers/scsi/scsi_debug.c | 119 +-

[PATCH] scsi_debug: rework resp_report_luns

2015-02-24 Thread Tomas Winkler
1. Fix the error check: the alloc length should be > 16 and not > 4 2. Remove duplicated boundary checks which simplify the fill-in loop 3. Use more of scsi generic API Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 119 +-

[scsi 1/2 V2] scsi_debug: schedule_resp fix input variable check

2015-02-23 Thread Tomas Winkler
The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Cc: Douglas Gilbert Signed-off-by: Tomas Winkler --- V2: 1. Actually drop struct scsi_device *sdp = cmnd->device;

[scsi 2/2] scsi_debug: fix REPORT LUNS Well Known LU

2015-02-23 Thread Tomas Winkler
The use case to report 'REPORT LUNS WLUN' described in scsi_debug documentation didn't work because: scsi_scan_host_selected() checks for: lun < shost->max_lun To fix this we set: max_lun = SCSI_W_LUN_REPORT_LUNS + 1; Signed-off-by: Tomas Winkler --- driv

[scsi 1/2] scsi_debug: schedule_resp fix input variable check

2015-02-23 Thread Tomas Winkler
The function should never be called with cmnd NULL so put a fat WARN there. Fix also smatch wraning: schedule_resp() warn: variable dereferenced before check 'cmnd' Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletion

[PATCH 0/4] scsi_debug cleanup

2015-02-18 Thread Tomas Winkler
I did some minor code cleanups while playing with scsi_debug module Tomas Winkler (4): scsi_debug: define pr_fmt() for consistent logging scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS; scsi_debug: vfree is null safe so drop the check scsi_debug: make

[PATCH 2/4] scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS;

2015-02-18 Thread Tomas Winkler
use SCSI_W_LUN_REPORT_LUNS from scsi.h instead of localy defined SAM2_WLUN_REPORT_LUNS Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index

[PATCH 4/4] scsi_debug: make dump_sector static

2015-02-18 Thread Tomas Winkler
fixes warning: warning: no previous prototype for ‘dump_sector’ Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 80410f9588ba..ccbe1282e975 100644 --- a

[PATCH 1/4] scsi_debug: define pr_fmt() for consistent logging

2015-02-18 Thread Tomas Winkler
Use pr_fmt with both module name and __func__ Also drop few bare printk leftovers The log format should stay pretty much intact Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 118 +- 1 file changed, 53 insertions(+), 65 deletions

[PATCH 3/4] scsi_debug: vfree is null safe so drop the check

2015-02-18 Thread Tomas Winkler
Signed-off-by: Tomas Winkler --- drivers/scsi/scsi_debug.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 11774cd1741a..80410f9588ba 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c

Re: BUG v3.19: reference count warning when removing scsi_debug device

2015-02-18 Thread Tomas Winkler
On Wed, Feb 18, 2015 at 7:38 PM, David Milburn wrote: > On 02/18/2015 07:22 AM, Tomas Winkler wrote: >> >> reference count warning when removing scsi_debug device >> >> ARNING: CPU: 2 PID: 16732 at kernel/module.c:954 module_put+0xc9/0xd0() >> [150550.9180

BUG v3.19: reference count warning when removing scsi_debug device

2015-02-18 Thread Tomas Winkler
reference count warning when removing scsi_debug device ARNING: CPU: 2 PID: 16732 at kernel/module.c:954 module_put+0xc9/0xd0() [150550.918033] Modules linked in: scsi_debug(-) pci_stub vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) nfsv3 rfcomm bnep bluetooth rpcsec_gss_krb5 nfsv4 hid_generic

Re: UFS RPMB

2014-12-15 Thread Tomas Winkler
Can you be more specific about Linux programming API Thanks On Mon, Dec 15, 2014 at 6:19 AM, Kyuho Choi wrote: > As i know, SECURITY PROTOCOL IN/OUT are support RPMB access for UFS. > > On 12/14/14, Tomas Winkler wrote: >> Hi, sorry fore a newbie question. >> What is the

UFS RPMB

2014-12-14 Thread Tomas Winkler
Hi, sorry fore a newbie question. What is the current interface for accessing rpmb LUN in a UFS devices. For emmc one need to issue a raw mmc ioctl command MMC_IOC_CMD. Thanks Tomas -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger