Re: -Wswitch Clang warnings in drivers/scsi

2018-10-18 Thread Nathan Chancellor
On Mon, Oct 08, 2018 at 11:47:09AM -0700, Bart Van Assche wrote: > On Thu, 2018-10-04 at 23:57 -0700, Nathan Chancellor wrote: > > Regardless of how the overflow is handled within the switch statement, > > the overflow is also happening when passing in these values to the ioctl, > > right? I mean t

[PATCH 3/8] sg: split header, expand and correct descriptions

2018-10-18 Thread Douglas Gilbert
Split scsi/sg.h into a smaller scsi/sg.h which includes a new header: uapi/scsi/sg.h . Overall expand the twin header files with new functionality in this patchset and functionality to be added in the next patchset to implement SG_IOSUBMIT and friends. Adjust format to modern kernel conventions. Co

[PATCH 7/8] sg: rework ioctl handling

2018-10-18 Thread Douglas Gilbert
Rework ioctl handling, report clearly to the log which ioctl has been invoked. Add a new "IOWR" ioctl: SG_SET_GET_EXTENDED which permits several integer and boolean values to be "_SET_" (i.e. passed into the driver, potentially changing its actions) and/or read from the driver (the "_GET_" part) in

[PATCH 5/8] sg: add free list, rework locking

2018-10-18 Thread Douglas Gilbert
Remove fixed 16 sg_request object array and replace with an active rq_list plus a request free list. Add finer grained spin lock to sg_request and do a major rework on locking. sg_request objects now are only de-allocated when the owning file descriptor is closed. This simplifies locking issues. S

[PATCH 6/8] sg: complete locking changes on ioctl+debug

2018-10-18 Thread Douglas Gilbert
Complete the locking and structure changes of ioctl and debug ('cat /proc/scsi/sg/debug') handling. Signed-off-by: Douglas Gilbert --- This was the code that was "#if 0'-ed out 2 patches ago. It also shuts checkpatch.pl up as it doesn't like that technique but offers no viable substitute. driv

[PATCH 8/8] sg: user control for q_at_head or tail

2018-10-18 Thread Douglas Gilbert
Add a SG_SET_GET_EXTENDED ioctl control for whether commands will be queued_at_head or queued_at_tail by the block layer (together with the scsi mid-level). It has file scope. Signed-off-by: Douglas Gilbert --- The user can still override this setting on a per command basis with the SG_FLAG_Q_AT

[PATCH 1/8] sg: types and naming cleanup

2018-10-18 Thread Douglas Gilbert
ROC_FS #include -static char *sg_version_date = "20140603"; +static char *sg_version_date = "20181018"; static int sg_proc_init(void); #endif @@ -73,7 +68,8 @@ static int sg_proc_init(void); #define SG_MAX_DEVS 32768 -/* SG_MAX_CDB_SIZE should be 260 (spc4r37 section 3.1.30) howe

[PATCH 4/8] sg: expand request states

2018-10-18 Thread Douglas Gilbert
Introduce the new rq_state defines. SG_RQ_DATA_THRESHOLD is a default value that if the data length of a request exceeds then, after that request is completed, the data buffer will be freed up as the sg_request object is placed on the free list. SG_TOT_FD_THRESHOLD is a default, per file descriptor

[PATCH 0/8] sg: major cleanup, remove max_queue limit

2018-10-18 Thread Douglas Gilbert
The intention is to add two new ioctls as proposed by Linus Torvalds: SG_IOSUBMIT and SG_IORECEIVE to replace the write()/read() async interface. But first, clean up the driver and remove the SG_MAX_QUEUE limit of no more than 16 queued commands on a file descriptor at a time. A free list has been

[PATCH 2/8] sg: introduce sg_log macro

2018-10-18 Thread Douglas Gilbert
Introduce the SG_LOG macro to replace long-winded 'SCSI_LOG_TIMEOUT(3, sg_printk ...' debug messages. Use __func__ wherever appropriate to make the debug messages more portable. Signed-off-by: Douglas Gilbert --- drivers/scsi/sg.c | 162 +- 1 file chan

Re: [PATCH 4/8] PCI: consolidate PCI config entry in drivers/pci

2018-10-18 Thread Max Filippov
Hi Christoph, On Wed, Oct 17, 2018 at 1:03 AM Christoph Hellwig wrote: > diff --git a/arch/xtensa/configs/iss_defconfig > b/arch/xtensa/configs/iss_defconfig > index 4bb5b76d9524..818849bb7736 100644 > --- a/arch/xtensa/configs/iss_defconfig > +++ b/arch/xtensa/configs/iss_defconfig > @@ -4,7 +4

Re: [PATCH 3/5] qla1280: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Bart Van Assche
On 10/18/18 9:47 PM, Bart Van Assche wrote: On 10/18/18 6:03 AM, Christoph Hellwig wrote: @@ -1790,8 +1783,8 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha)   mb[4] = cnt;   mb[3] = ha->request_dma & 0x;   mb[2] = (ha->request_dma >> 16) & 0x; -    mb[7

Re: [PATCH 4/8] PCI: consolidate PCI config entry in drivers/pci

2018-10-18 Thread Masahiro Yamada
On Wed, Oct 17, 2018 at 5:04 PM Christoph Hellwig wrote: > > There is no good reason to duplicate the PCI menu in every architecture. > Instead provide a selectable HAS_PCI symbol that indicates availability HAS_PCI -> HAVE_PCI > of PCI support and the handle the rest in drivers/pci. > > Note t

Re: [PATCH 6/8] rapidio: consolidate RAPIDIO config entry in drivers/rapidio

2018-10-18 Thread Masahiro Yamada
On Wed, Oct 17, 2018 at 5:03 PM Christoph Hellwig wrote: > > There is no good reason to duplicate the RAPIDIO menu in various > architectures. Instead provide a selectable HAS_RAPIDIO symbol Nit. HAS_RAPIDIO -> HAVE_RAPIDIO. > that indicates native availability of RAPIDIO support and the han

Re: [PATCH 7/8] eisa: consolidate EISA Kconfig entry in drivers/eisa

2018-10-18 Thread Masahiro Yamada
On Wed, Oct 17, 2018 at 5:03 PM Christoph Hellwig wrote: > > Let architectures opt into EISA support by selecting HAS_EISA and Nit. HAS_EISA -> HAVE_EISA since you renamed it in this version. > handle everything else in drivers/eisa. > > Signed-off-by: Christoph Hellwig > Acked-by: Thomas Gl

Re: [PATCH 3/5] qla1280: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Bart Van Assche
On 10/18/18 6:03 AM, Christoph Hellwig wrote: @@ -1790,8 +1783,8 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha) mb[4] = cnt; mb[3] = ha->request_dma & 0x; mb[2] = (ha->request_dma >> 16) & 0x; - mb[7] = pci_dma_hi32(ha-

Re: [PATCH 7/8] eisa: consolidate EISA Kconfig entry in drivers/eisa

2018-10-18 Thread Masahiro Yamada
On Wed, Oct 17, 2018 at 5:03 PM Christoph Hellwig wrote: > > Let architectures opt into EISA support by selecting HAS_EISA and > handle everything else in drivers/eisa. > > Signed-off-by: Christoph Hellwig > Acked-by: Thomas Gleixner > --- > index 60e37b9a715d..c90a1a4d6079 100644 > --- a/arch

Re: [PATCH 5/5] qla2xxx: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Bart Van Assche
On 10/18/18 6:03 AM, Christoph Hellwig wrote: This also moves the optimization for builds with 32-bit dma_addr_t to the compiler (where it belongs) instead of opencoding it based on incorrect assumptions. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla2xxx/qla_target.c | 8 dr

Re: [PATCH 0/7] qla2xxx patches for kernel v4.20

2018-10-18 Thread Madhani, Himanshu
Hello Bart, > On Oct 18, 2018, at 3:45 PM, Bart Van Assche wrote: > > External Email > > Hi Martin, > > This is a series with mostly trivial patches for the qla2xxx driver. These > patches address warnings reported by gcc and by the smatch and sparse static > analyzers. Please consider these

Re: [PATCH v3 0/5] qla2xxx: Add FC-NVMe Target support

2018-10-18 Thread Madhani, Himanshu
Hello All, > On Sep 28, 2018, at 3:46 PM, Himanshu Madhani > wrote: > > Hi Martin, > > This series adds support for FC-NVMe Target. > > Patch #1 adds infrastructure to support FC-NVMeT Link Service processing. > Patch #2 adds addes new qla_nvmet.[ch] files for FC-NVMe Target support. > Pat

Re: [PATCH v2] scsi: hisi_sas: Fix NULL pointer dereference

2018-10-18 Thread chenxiang (M)
在 2018/10/19 0:59, Gustavo A. R. Silva 写道: There is a NULL pointer dereference in case *slot* happens to be NULL at lines 1053 and 1878: struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue]; Notice that *slot* is being NULL checked at lines 1057 and 1881: if (slot), which implies i

[PATCH] scsi: myrs: fix build failure on 32 bit

2018-10-18 Thread James Bottomley
For 32 bit versions we have to be careful about divisions of 64 bit quantities so use do_div() instead of a direct division. This fixes a warning about _uldivmod being undefined in certain configurations Fixes: 77266186397c ("scsi: myrs: Add Mylex RAID controller") Reported-by: kbuild test robot

Re: [scsi:misc 194/233] ERROR: "__aeabi_uldivmod" [drivers/scsi/myrs.ko] undefined!

2018-10-18 Thread James Bottomley
On Thu, 2018-10-18 at 10:28 -0700, James Bottomley wrote: > On Fri, 2018-10-19 at 01:18 +0800, kbuild test robot wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.g > > it > > misc > > head: 4d5b4ac1eae471bcd0fa381ab4099cc33e94e15d > > commit: 77266186397c6c782a3f670d3

[PATCH 5/7] qla2xxx: Remove a set-but-not-used variable

2018-10-18 Thread Bart Van Assche
This patch does not change any functionality. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_os.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index dba672f87cb2..01607d2

[PATCH 6/7] qla2xxx: Make sure that qlafx00_ioctl_iosb_entry() initializes 'res'

2018-10-18 Thread Bart Van Assche
Only one of the two code paths in qlafx00_ioctl_iosb_entry() initializes the variable 'res'. Make sure that 'res' is initialized before sp->done(sp, res) is called. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_mr.c | 2 +- 1 file changed, 1 insertion(+), 1 de

[PATCH 4/7] qla2xxx: Make qla2x00_sysfs_write_nvram() easier to analyze

2018-10-18 Thread Bart Van Assche
Modify the unlock statement such that it becomes easier for static analyzers to analyze it. This patch does not change any functionality. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_attr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH 7/7] qla2xxx: Remove two arguments from qlafx00_error_entry()

2018-10-18 Thread Bart Van Assche
Move a debug statement from qlafx00_error_entry() into its caller. Remove one unused argument from that function. This patch does not change the behavior of the qla2xxx driver. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_mr.c | 13 + 1 file chang

[PATCH 1/7] qla2xxx: Modify fall-through annotations

2018-10-18 Thread Bart Van Assche
This patch avoids that the compiler complains about missing fall-through annotations when building with W=1. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 2 +- drivers/scsi/qla2xxx/qla_target.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(

[PATCH 3/7] qla2xxx: Declare local functions 'static'

2018-10-18 Thread Bart Van Assche
This patch avoids that the compiler complains about missing declarations when building with W=1. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/dri

[PATCH 2/7] qla2xxx: Improve several kernel-doc headers

2018-10-18 Thread Bart Van Assche
This patch avoids that complaints about kernel-doc headers are reported when building with W=1. Cc: Himanshu Madhani Signed-off-by: Bart Van Assche --- drivers/scsi/qla2xxx/qla_iocb.c | 4 ++-- drivers/scsi/qla2xxx/qla_isr.c| 6 +++--- drivers/scsi/qla2xxx/qla_mbx.c| 6 +++--- drivers

[PATCH 0/7] qla2xxx patches for kernel v4.20

2018-10-18 Thread Bart Van Assche
Hi Martin, This is a series with mostly trivial patches for the qla2xxx driver. These patches address warnings reported by gcc and by the smatch and sparse static analyzers. Please consider these patches for kernel v4.20. Thanks, Bart. Bart Van Assche (7): qla2xxx: Modify fall-through annotat

Re: [PATCH 2/4] gdth: reuse dma coherent allocation in gdth_show_info

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > gdth_show_info currently allocs and frees a dma buffer four times, > which isn't very efficient. Reuse a single allocation instead. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/gdth_proc.c | 18 +- > 1 file changed, 5

Re: [PATCH 1/4] gdth: refactor ioc_general

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > + > +static int ioc_general(void __user *arg, char *cmnd) > +{ > + gdth_ioctl_general gen; > + gdth_ha_str *ha; > + char *buf = NULL; > + u64 paddr; > + int rval; > + > + if (copy_from_user(&gen, arg, sizeof(gdth_ioctl_general

Re: [PATCH 4/4] gdth: use generic DMA API

2018-10-18 Thread Finn Thain
On Thu, 18 Oct 2018, Christoph Hellwig wrote: > Switch from the legacy PCI DMA API to the generic DMA API. Also switch > to dma_map_single from pci_map_page in one case where this makes the code > simpler. > > Signed-off-by: Christoph Hellwig > --- > drivers/scsi/gdth.c | 111

[PATCH] scsi: 3w-{sas,9xxx}: Use unsigned char for cdb

2018-10-18 Thread Nathan Chancellor
Clang warns a few times: drivers/scsi/3w-sas.c:386:11: warning: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Wconstant-conversion] cdb[4] = TW_ALLOCATION_LENGTH; /* allocation length */ ~ ^~~~ Update cdb's type to unsigned char,

Re: [PATCH RESEND] scsi: qla2xxx: I/Os timing out on surprise removal of

2018-10-18 Thread Madhani, Himanshu
Martin, Bill, > On Oct 17, 2018, at 5:51 PM, Martin K. Petersen > wrote: > > External Email > > Himanshu, > >> When doing a surprise removal of an adapter, some in flight I/Os can get >> stuck and take a while to complete (they actually timeout and are >> retried). We are not handling an ear

Re: SCSI qla2xxx: tcm_qla2xxx target server code regession

2018-10-18 Thread Laurence Oberman
On Wed, 2018-10-17 at 16:42 -0400, Laurence Oberman wrote: > On Mon, 2018-10-15 at 08:51 -0400, Laurence Oberman wrote: > > On Sat, 2018-10-13 at 10:42 -0400, Laurence Oberman wrote: > > > On Fri, 2018-10-12 at 17:51 -0700, Bart Van Assche wrote: > > > > On 10/12/18 1:36 PM, Laurence Oberman wrote:

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Jens Axboe
On 10/18/18 2:58 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 22:28:35 Jens Axboe wrote: >> On 10/18/18 2:22 PM, Ondrej Zary wrote: >>> On Thursday 18 October 2018 22:10:31 Jens Axboe wrote: On 10/18/18 2:04 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 21:59:09 Jens Axboe w

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Ondrej Zary
On Thursday 18 October 2018 22:28:35 Jens Axboe wrote: > On 10/18/18 2:22 PM, Ondrej Zary wrote: > > On Thursday 18 October 2018 22:10:31 Jens Axboe wrote: > >> On 10/18/18 2:04 PM, Ondrej Zary wrote: > >>> On Thursday 18 October 2018 21:59:09 Jens Axboe wrote: > On 10/18/18 1:55 PM, Ondrej Za

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Jens Axboe
On 10/18/18 2:22 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 22:10:31 Jens Axboe wrote: >> On 10/18/18 2:04 PM, Ondrej Zary wrote: >>> On Thursday 18 October 2018 21:59:09 Jens Axboe wrote: On 10/18/18 1:55 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 20:58:57 Jens Axboe w

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Ondrej Zary
On Thursday 18 October 2018 22:10:31 Jens Axboe wrote: > On 10/18/18 2:04 PM, Ondrej Zary wrote: > > On Thursday 18 October 2018 21:59:09 Jens Axboe wrote: > >> On 10/18/18 1:55 PM, Ondrej Zary wrote: > >>> On Thursday 18 October 2018 20:58:57 Jens Axboe wrote: > On 10/18/18 12:34 PM, Ondrej Z

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Jens Axboe
On 10/18/18 2:04 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 21:59:09 Jens Axboe wrote: >> On 10/18/18 1:55 PM, Ondrej Zary wrote: >>> On Thursday 18 October 2018 20:58:57 Jens Axboe wrote: On 10/18/18 12:34 PM, Ondrej Zary wrote: > Hello, > aha1542 works fine in 4.17 but cras

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Ondrej Zary
On Thursday 18 October 2018 21:59:09 Jens Axboe wrote: > On 10/18/18 1:55 PM, Ondrej Zary wrote: > > On Thursday 18 October 2018 20:58:57 Jens Axboe wrote: > >> On 10/18/18 12:34 PM, Ondrej Zary wrote: > >>> Hello, > >>> aha1542 works fine in 4.17 but crashes in 4.18. It's hard to bisect > >>> bec

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Jens Axboe
On 10/18/18 1:55 PM, Ondrej Zary wrote: > On Thursday 18 October 2018 20:58:57 Jens Axboe wrote: >> On 10/18/18 12:34 PM, Ondrej Zary wrote: >>> Hello, >>> aha1542 works fine in 4.17 but crashes in 4.18. It's hard to bisect because >>> of many commits that don't compile. >>> # only skipped commits

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Ondrej Zary
On Thursday 18 October 2018 20:58:57 Jens Axboe wrote: > On 10/18/18 12:34 PM, Ondrej Zary wrote: > > Hello, > > aha1542 works fine in 4.17 but crashes in 4.18. It's hard to bisect because > > of many commits that don't compile. > > # only skipped commits left to test > > # possible first bad commi

Re: dma related cleanups for wd719x

2018-10-18 Thread Ondrej Zary
On Thursday 18 October 2018 15:01:14 Christoph Hellwig wrote: > Hi Ondrej, > > can you look over this series, which cleans up a few dma-related > bits in the wd719x driver? > Looks nice but does not work. The first patch works, but the 2nd one causes hang on modprobe: [ 408.350359] wd719x :

Re: bioset changes in 4.18 broke aha1542

2018-10-18 Thread Jens Axboe
On 10/18/18 12:34 PM, Ondrej Zary wrote: > Hello, > aha1542 works fine in 4.17 but crashes in 4.18. It's hard to bisect because > of many commits that don't compile. > # only skipped commits left to test > # possible first bad commit: [52190f8abe7f2bf2b4e5f9760cbcc1427ca2136b] fs: > convert block_

bioset changes in 4.18 broke aha1542

2018-10-18 Thread Ondrej Zary
Hello, aha1542 works fine in 4.17 but crashes in 4.18. It's hard to bisect because of many commits that don't compile. # only skipped commits left to test # possible first bad commit: [52190f8abe7f2bf2b4e5f9760cbcc1427ca2136b] fs: convert block_dev.c to bioset_init() # possible first bad commit: [

[PATCH v2] scsi: hisi_sas: Fix NULL pointer dereference

2018-10-18 Thread Gustavo A. R. Silva
There is a NULL pointer dereference in case *slot* happens to be NULL at lines 1053 and 1878: struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue]; Notice that *slot* is being NULL checked at lines 1057 and 1881: if (slot), which implies it may be NULL. Fix this by placing the decla

Re: [scsi:misc 194/233] ERROR: "__aeabi_uldivmod" [drivers/scsi/myrs.ko] undefined!

2018-10-18 Thread James Bottomley
On Fri, 2018-10-19 at 01:18 +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git > misc > head: 4d5b4ac1eae471bcd0fa381ab4099cc33e94e15d > commit: 77266186397c6c782a3f670d32808a9671806ec5 [194/233] scsi: > myrs: Add Mylex RAID controller (SCSI i

Re: [PATCH v2 3/7] drivers/base: Probe devices concurrently if requested by the driver

2018-10-18 Thread Alexander Duyck
On 10/18/2018 10:15 AM, Greg KH wrote: On Thu, Oct 18, 2018 at 09:51:03AM -0700, Alexander Duyck wrote: On 10/18/2018 9:46 AM, Bart Van Assche wrote: On Thu, 2018-10-18 at 08:25 -0700, Alexander Duyck wrote: On 10/17/2018 5:54 PM, Dan Williams wrote: On Wed, Oct 17, 2018 at 4:41 PM Bart Va

[scsi:misc 194/233] ERROR: "__aeabi_uldivmod" [drivers/scsi/myrs.ko] undefined!

2018-10-18 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git misc head: 4d5b4ac1eae471bcd0fa381ab4099cc33e94e15d commit: 77266186397c6c782a3f670d32808a9671806ec5 [194/233] scsi: myrs: Add Mylex RAID controller (SCSI interface) config: arm-allmodconfig (attached as .config) compiler: arm

Re: [PATCH v2 3/7] drivers/base: Probe devices concurrently if requested by the driver

2018-10-18 Thread Greg KH
On Thu, Oct 18, 2018 at 09:51:03AM -0700, Alexander Duyck wrote: > On 10/18/2018 9:46 AM, Bart Van Assche wrote: > > On Thu, 2018-10-18 at 08:25 -0700, Alexander Duyck wrote: > > > On 10/17/2018 5:54 PM, Dan Williams wrote: > > > > On Wed, Oct 17, 2018 at 4:41 PM Bart Van Assche > > > > wrote: >

Re: [PATCH] scsi: hisi_sas: Fix NULL pointer dereference

2018-10-18 Thread Gustavo A. R. Silva
Hi, I just found another instance of this same issue at line 1053. Please, drop this patch and I'll send v2 addressing both instances, shortly. Thanks -- Gustavo On 10/18/18 6:41 PM, Gustavo A. R. Silva wrote: > There is a NULL pointer dereference in case *slot* happens to > be NULL at line 187

[PATCH] scsi: hisi_sas: Fix NULL pointer dereference

2018-10-18 Thread Gustavo A. R. Silva
There is a NULL pointer dereference in case *slot* happens to be NULL at line 1878: struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue]; Notice that *slot* is being NULL checked at line 1881: if (slot), which implies it may be NULL. Fix this by placing the declaration and definitio

Re: [PATCH v2 3/7] drivers/base: Probe devices concurrently if requested by the driver

2018-10-18 Thread Alexander Duyck
On 10/18/2018 9:46 AM, Bart Van Assche wrote: On Thu, 2018-10-18 at 08:25 -0700, Alexander Duyck wrote: On 10/17/2018 5:54 PM, Dan Williams wrote: On Wed, Oct 17, 2018 at 4:41 PM Bart Van Assche wrote: Instead of probing devices sequentially in the PROBE_PREFER_ASYNCHRONOUS mode, scan device

Re: [PATCH v2 1/7] drivers/base: Fix a race condition in the device probing code

2018-10-18 Thread Bart Van Assche
On Thu, 2018-10-18 at 07:10 +0200, Greg Kroah-Hartman wrote: > > diff --git a/drivers/base/dd.c b/drivers/base/dd.c > > index edfc9f0b1180..b4212154a94b 100644 > > --- a/drivers/base/dd.c > > +++ b/drivers/base/dd.c > > @@ -645,6 +645,14 @@ int driver_probe_device(struct device_driver *drv, > > st

Re: [PATCH v2 3/7] drivers/base: Probe devices concurrently if requested by the driver

2018-10-18 Thread Bart Van Assche
On Thu, 2018-10-18 at 08:25 -0700, Alexander Duyck wrote: > On 10/17/2018 5:54 PM, Dan Williams wrote: > > On Wed, Oct 17, 2018 at 4:41 PM Bart Van Assche wrote: > > > > > > Instead of probing devices sequentially in the PROBE_PREFER_ASYNCHRONOUS > > > mode, scan devices concurrently. This helps

Re: [PATCH] scsi/mvsas/mv_sas.c: Use dma_pool_zalloc

2018-10-18 Thread John Garry
On 18/10/2018 17:06, Sabyasachi Gupta wrote: Replaced dma_pool_alloc + memset with dma_pool_zalloc Signed-off-by: Sabyasachi Gupta --- drivers/scsi/mvsas/mv_sas.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c inde

Re: [PATCH] scsi/mvsas/mv_sas.c: Use dma_pool_zalloc

2018-10-18 Thread Jinpu Wang
On Thu, Oct 18, 2018 at 6:06 PM Sabyasachi Gupta wrote: > > Replaced dma_pool_alloc + memset with dma_pool_zalloc > Signed-off-by: Sabyasachi Gupta Reviewed-by: Jack Wang Thanks! > --- > drivers/scsi/mvsas/mv_sas.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) -- Jack Wang Linux

[PATCH] scsi/mvsas/mv_sas.c: Use dma_pool_zalloc

2018-10-18 Thread Sabyasachi Gupta
Replaced dma_pool_alloc + memset with dma_pool_zalloc Signed-off-by: Sabyasachi Gupta --- drivers/scsi/mvsas/mv_sas.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c index cff43bd..d00d37d 100644 --- a/drivers/scsi/mv

[scsi:misc 194/233] ERROR: "__udivdi3" [drivers/scsi/myrs.ko] undefined!

2018-10-18 Thread kbuild test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git misc head: 4d5b4ac1eae471bcd0fa381ab4099cc33e94e15d commit: 77266186397c6c782a3f670d32808a9671806ec5 [194/233] scsi: myrs: Add Mylex RAID controller (SCSI interface) config: i386-allmodconfig (attached as .config) compiler: gc

Re: [PATCH v2 2/7] drivers/base: Verify struct device locking requirements at runtime

2018-10-18 Thread Bart Van Assche
On Thu, 2018-10-18 at 07:11 +0200, Greg Kroah-Hartman wrote: > On Wed, Oct 17, 2018 at 04:40:01PM -0700, Bart Van Assche wrote: > > Make sure that a complaint appears in the kernel log if the driver core > > locking assumptions are violated. > > > > Cc: Lee Duncan > > Cc: Hannes Reinecke > > Cc:

Re: [PATCH v2 3/7] drivers/base: Probe devices concurrently if requested by the driver

2018-10-18 Thread Alexander Duyck
On 10/17/2018 5:54 PM, Dan Williams wrote: On Wed, Oct 17, 2018 at 4:41 PM Bart Van Assche wrote: Instead of probing devices sequentially in the PROBE_PREFER_ASYNCHRONOUS mode, scan devices concurrently. This helps when the wall clock time for a single probe is significantly above the CPU time

Re: [PATCH V15 1/2] scsi: ufs: set the device reference clock setting

2018-10-18 Thread Rob Herring
On Tue, Oct 16, 2018 at 02:29:41PM +0530, Sayali Lokhande wrote: > From: Subhash Jadavani > > UFS host supplies the reference clock to UFS device and UFS device > specification allows host to provide one of the 4 frequencies (19.2 MHz, > 26 MHz, 38.4 MHz, 52 MHz) for reference clock. Host should

Re: [PATCH 05/12] hisi_sas: use dma_set_mask_and_coherent

2018-10-18 Thread John Garry
On 18/10/2018 14:10, Christoph Hellwig wrote: The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 1 file changed, 5

use dma_set_mask and dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
Various SCSI drivers that otherwise use the generic DMA API still use pci_set_dma_mask, so switch them over to dma_set_mask and dma_set_mask_and_coherent.

[PATCH 03/12] dpt_i2o: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Also move the dma_get_required_mask check before actually setting the dma mask, so that we don't end up with inconsistent settings in corner cases. Signed-off-by: Christoph Hellwig --- drivers/scsi/dpt_i2o.c

[PATCH 12/12] sym53c8xx: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/sym53c8xx_2/sym_glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2

[PATCH 01/12] arcmsr: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/arcmsr/arcmsr_hba.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_

[PATCH 02/12] bfa: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API helper and also ensure we set the coherent mask as well in the resume path. Signed-off-by: Christoph Hellwig --- drivers/scsi/bfa/bfad.c | 18 +++---

[PATCH 11/12] stex: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/stex.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/stex

[PATCH 10/12] mvumi: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/mvumi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index 2458974d1af6..3d2d026d1ccf 10064

[PATCH 05/12] hisi_sas: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dri

[PATCH 08/12] iscsi: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/isci/init.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/sc

[PATCH 06/12] hptiop: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/hptiop.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 2fad7f03aa02..dc52

[PATCH 04/12] esas2r: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Also move the dma_get_required_mask check before actually setting the dma mask, so that we don't end up with inconsistent settings in corner cases. Signed-off-by: Christoph Hellwig --- drivers/scsi/esas2r/es

[PATCH 09/12] lpfc: use dma_set_mask_and_coherent

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Switch it over to the better generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/lpfc/lpfc_init.c | 34 ++ 1 file changed, 10 insertions(+), 24 deletions(-) di

[PATCH 07/12] initio: use dma_set_mask

2018-10-18 Thread Christoph Hellwig
The driver currently uses pci_set_dma_mask despite otherwise using the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/initio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 7a91cf3ff173..0a8d786c84ed 10

[PATCH 3/4] gdth: remove gdth_{alloc,free}_ioctl

2018-10-18 Thread Christoph Hellwig
Out of the three callers once insists on the scratch buffer, and the others are fine with a new allocation. Switch those two to juse use pci_alloc_consistent directly, and open code the scratch buffer allocation in the remaining one. This avoids a case where we might be doing a memory allocation

[PATCH 4/4] gdth: use generic DMA API

2018-10-18 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Also switch to dma_map_single from pci_map_page in one case where this makes the code simpler. Signed-off-by: Christoph Hellwig --- drivers/scsi/gdth.c | 111 +++ drivers/scsi/gdth_proc.c | 4 +

[PATCH 1/4] gdth: refactor ioc_general

2018-10-18 Thread Christoph Hellwig
This function is a huge mess with duplicated error handling. Split out a few useful helpers and use goto labels to untangle the error handling and no-data ioctl handling. Signed-off-by: Christoph Hellwig --- drivers/scsi/gdth.c | 247 +++- 1 file changed,

dma related cleanups for gdth

2018-10-18 Thread Christoph Hellwig
Cleans up various oddities found during a code audit.

[PATCH 2/4] gdth: reuse dma coherent allocation in gdth_show_info

2018-10-18 Thread Christoph Hellwig
gdth_show_info currently allocs and frees a dma buffer four times, which isn't very efficient. Reuse a single allocation instead. Signed-off-by: Christoph Hellwig --- drivers/scsi/gdth_proc.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/gdt

dma related cleanups for pmcraid

2018-10-18 Thread Christoph Hellwig
Cleans up various oddities found during a code audit.

[PATCH 3/3] pmcraid: use generic DMA API

2018-10-18 Thread Christoph Hellwig
Switch from the legacy PCI DMA API to the generic DMA API. Signed-off-by: Christoph Hellwig --- drivers/scsi/pmcraid.c | 79 +++--- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 401e543f17

[PATCH 1/3] pmcraid: simplify pmcraid_cancel_all a bit

2018-10-18 Thread Christoph Hellwig
No need for a local cmd_done variable, and pass boolean values as bool type instead of u32. Signed-off-by: Christoph Hellwig --- drivers/scsi/pmcraid.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 4e86994e

[PATCH 2/3] pmcraid: don't allocate a dma coherent buffer for sense data

2018-10-18 Thread Christoph Hellwig
We can just dma map the sense buffer passed with the scsi command, and that gets us out of the nasty business of doing dma coherent allocations from irq context. Signed-off-by: Christoph Hellwig --- drivers/scsi/pmcraid.c | 24 1 file changed, 8 insertions(+), 16 deletio

[PATCH 5/5] qla2xxx: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Christoph Hellwig
This also moves the optimization for builds with 32-bit dma_addr_t to the compiler (where it belongs) instead of opencoding it based on incorrect assumptions. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla2xxx/qla_target.c | 8 drivers/scsi/qla2xxx/qla_target.h | 8 2 fi

[PATCH 4/5] qla1280: properly handle 64-bit DMA

2018-10-18 Thread Christoph Hellwig
CONFIG_HIGHMEM is not in fact an indicator for > 32-bit dma addressing Given that the driver is a bit weird and wants a compile time selection switch to checking CONFIG_ARCH_DMA_ADDR_T_64BIT instead. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla1280.c | 5 + 1 file changed, 1 inserti

fix up a few drivers for 64-bit dma addresses

2018-10-18 Thread Christoph Hellwig
Some drivers make very odd decisions on when to use support for 64-bit addressing. Fix this up a bit.

[PATCH 2/5] ips: properly handle 64-bit DMA

2018-10-18 Thread Christoph Hellwig
CONFIG_HIGHMEM64 is only one (and these days unusual) way to indicate that > 32-bit dma address are possible. Replace it with a check of the dma_addr_t size. Signed-off-by: Christoph Hellwig --- drivers/scsi/ips.c | 2 +- drivers/scsi/ips.h | 6 -- 2 files changed, 1 insertion(+), 7 deletio

[PATCH 1/5] ips: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/scsi/ips.c | 6 +++--- drivers/scsi/ips.h | 3 --- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index ee8a1ecd58fd..679321e96a86 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -1801

[PATCH 3/5] qla1280: use lower_32_bits and upper_32_bits instead of reinventing them

2018-10-18 Thread Christoph Hellwig
This also moves the optimization for builds with 32-bit dma_addr_t to the compiler (where it belongs) instead of opencoding it. Signed-off-by: Christoph Hellwig --- drivers/scsi/qla1280.c | 47 ++ 1 file changed, 20 insertions(+), 27 deletions(-) diff --g

[PATCH 2/3] wd719x: use per-command private data

2018-10-18 Thread Christoph Hellwig
Add the SCB onto the scsi command allocation and use dma streaming mappings for it only when in use. This avoid possibly calling dma_alloc_coherent under a lock or even in irq context, while also making the code simpler. Signed-off-by: Christoph Hellwig --- drivers/scsi/wd719x.c | 95 ++

[PATCH 3/3] wd719x: always use generic DMA API

2018-10-18 Thread Christoph Hellwig
The wd719x driver currently uses a mix of the legacy PCI DMA and the generic DMA APIs. Switch it over to the generic DMA API entirely. Signed-off-by: Christoph Hellwig --- drivers/scsi/wd719x.c | 32 +--- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git

[PATCH 1/3] wd719x: there should be no active SCBs on removal

2018-10-18 Thread Christoph Hellwig
So warn on that case instead of trying to free them, which would be fatal in case we actuall had active ones. Signed-off-by: Christoph Hellwig --- drivers/scsi/wd719x.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/wd719x.c b/drivers/scsi/wd719x.c index 97

dma related cleanups for wd719x

2018-10-18 Thread Christoph Hellwig
Hi Ondrej, can you look over this series, which cleans up a few dma-related bits in the wd719x driver?

Re: [PATCH -next] scsi: hisi_sas: Fix missing unlock on error in hisi_sas_phy_read32()

2018-10-18 Thread John Garry
On 18/10/2018 04:58, Wei Yongjun wrote: Add the missing unlock before return from function hisi_sas_phy_read32() in the error handling case. Fixes: 784b46b7cba0 ("scsi: hisi_sas: Use block layer tag instead for IPTT") Signed-off-by: Wei Yongjun --- drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 4 ++

Re: [PATCH v4 00/11] Zoned block device support improvements

2018-10-18 Thread Damien Le Moal
On 2018/10/16 11:34, Jens Axboe wrote: > On 10/14/18 6:45 PM, Damien Le Moal wrote: >> Jens, >> >> On 2018/10/14 7:43, Jens Axboe wrote: >>> On 10/12/18 4:08 AM, Damien Le Moal wrote: This series improves zoned block device support (reduce overhead) and introduces many simplifications to

  1   2   >