Re: [PATCH] scsi: sg: fix a missing-check bug

2018-05-06 Thread Douglas Gilbert
On 2018-05-05 11:21 PM, Wenwen Wang wrote: In sg_write(), the opcode of the command is firstly copied from the userspace pointer 'buf' and saved to the kernel variable 'opcode', using the __get_user() function. The size of the command, i.e., 'cmd_size' is then calculated based on the 'opcode'.

[PATCH-next] scsi: libsas: dynamically allocate and free ata host

2018-05-06 Thread Jason Yan
Now the ata host for libsas is embedded in domain_device, and the ->kref member is not initialized. Afer we add ata transport class, ata_host_get() will be called when adding transport ATA port and a warning will be triggered as below: refcount_t: increment on 0; use-after-free. WARNING: CPU: 2

Re: simplify procfs code for seq_file instances V2

2018-05-06 Thread Al Viro
On Sun, May 06, 2018 at 08:19:49PM +0300, Alexey Dobriyan wrote: > +++ b/fs/proc/internal.h > @@ -48,8 +48,8 @@ struct proc_dir_entry { > const struct seq_operations *seq_ops; > int (*single_show)(struct seq_file *, void *); > }; > - unsigned int state_size; >

Re: simplify procfs code for seq_file instances V2

2018-05-06 Thread Alexey Dobriyan
On Wed, Apr 25, 2018 at 05:47:47PM +0200, Christoph Hellwig wrote: > Changes since V1: > - open code proc_create_data to avoid setting not fully initialized >entries live > - use unsigned int for state_size Need this to maintain sizeof(struct proc_dir_entry): Otherwise ACK fs/proc/ part.

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

2018-05-06 Thread Alim Akhtar
This makes ufshcd_config_pwr_mode non-static so that other vendors like exynos can use the same. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 5 ++--- drivers/scsi/ufs/ufshcd.h | 2 ++ 2 files changed, 4

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

2018-05-06 Thread Alim Akhtar
Some host controller supports interrupt aggregation, but doesn't allow to reset counter and timer by s/w. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 3 ++- drivers/scsi/ufs/ufshcd.h | 6 ++ 2 files

[PATCH 1/4] scsi: ufs: add quirk to fix mishandling utrlclr/utmrlclr

2018-05-06 Thread Alim Akhtar
In the right behavior, setting the bit to '0' indicates clear and '1' indicates no change. If host controller handles this the other way, UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR can be used. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar ---

[PATCH 3/4] scsi: ufs: add quirk to enable host controller without hce

2018-05-06 Thread Alim Akhtar
Some host controller doesn't support host controller enable via HCE. Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 75 +-- drivers/scsi/ufs/ufshcd.h | 5 2

[PATCH 0/4] Add required changes to ufshcd to support exynos ufs hci

2018-05-06 Thread Alim Akhtar
Hi All These patches are part of a larger patch series [1] which attempts upstreaming EXYNOS UFS driver support. There was not much activities after v5 of that series. In between I saw there were other teams in Samsung tried upstreaming the same, but that has not really gone anywhere. I have