Introduce bitops in sg_device to replace an atomic, a bool and a
char. That char (sgdebug) had been reduced to only two states.
Add some associated macros to make the code a little clearer.
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 104 +++---
Typedefs for structure types are discouraged so those structures
that are private to the driver have had their typedefs removed.
This also means that most "camel" type variable names (i.e. mixed
case) have been removed.
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 394
Re-arrange code in sg_poll(). Rename sg_read_oxfer() to
sg_rd_append(). In sg_start_req() rename rw to r0w.
Plus associated changes demanded by checkpatch.pl
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 65 ++-
1 file changed, 30 insertions(+
The biggest single item in the sg_request object is the sense
buffer array which is SCSI_SENSE_BUFFERSIZE bytes long. That
constant started out at 18 bytes 20 years ago and is 96 bytes
now and might grow in the future. On the other hand the sense
buffer is only used by a small number of SCSI comman
Since the version 2 driver, the state of the driver can be found
with 'cat /proc/scsi/sg/debug'. As the driver becomes more
threaded and IO faster (e.g. scsi_debug with a command timer
of 5 microseconds), the existing state dump can become
misleading as the state can change during the "snapshot". T
Add ioctl(SG_IOSUBMIT_V3) and ioctl(SG_IORECEIVE_V3). These ioctls
are meant to be (almost) drop-in replacements for the write()/read()
async version 3 interface. They only accept the version 3 interface.
See the webpage at: http://sg.danny.cz/sg/sg_v40.html
specifically the table in the section t
Now that the sg version 4 interface is supported:
- with ioctl(SG_IO) for synchronous/blocking use
- with ioctl(SG_IOSUBMIT) and ioctl(SG_IORECEIVE) for
async/non-blocking use
Plus new ioctl(SG_IOSUBMIT_V3) and ioctl(SG_IORECEIVE_V3)
potentially replace write() and read() for the sg
version
Convert sg_device::open_cnt into an atomic. Also rename
sg_tablesize into the more descriptive max_sgat_elems.
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 39 ---
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/sg.c b/dr
Add support for the sg v4 interface based on struct sg_io_v4 found
in include/uapi/linux/bsg.h and only previously supported by the
bsg driver. Add ioctl(SG_IOSUBMIT) and ioctl(SG_IORECEIVE) for
async (non-blocking) usage of the sg v4 interface. Do not accept
the v3 interface with these ioctls. Do
The existing ioctl(SG_GET_SCSI_ID) fills a object of type
struct sg_scsi_id whose last field is int unused[2]. Add
an anonymous union with u8 scsi_lun[8] sharing those last
8 bytes. This patch will place the current device's full
LUN in the scsi_lun array using T10's preferred LUN
format (i.e. an a
Since access_ok() has lost it direction (3rd) parameter there
seems to be no benefit in calling access_ok() before
__copy_{to|from}_user(). Simplify code by using the variant of
these functions that do not start with "__".
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 50 +++
Track the number of submitted and waiting (for read/receive)
requests on each file descriptor with two atomic integers.
This speeds sg_poll() and ioctl(SG_GET_NUM_WAITING) which
are oft used with the asynchronous (non-blocking) interfaces.
Signed-off-by: Douglas Gilbert
---
drivers/scsi/sg.c | 5
Add sg_allow_if_err_recover() to do checks common to several entry
points. Replace retval with either res or ret. Rename
sg_finish_rem_req() to sg_finish_scsi_blk_rq(). Rename
sg_new_write() to sg_submit(). Other cleanups triggered by
checkpatch.pl .
Signed-off-by: Douglas Gilbert
---
drivers/sc
This patchset extends the SCSI generic (sg) driver found in lk 5.3 .
The sg driver has a version number which is visible via
ioctl(SG_GET_VERSION_NUM) and is bumped from 3.5.36 to 4.0.03 by this
patchset. The additions and changes are described in some detail in
this long webpage:
http://sg.dan
Move main entry point functions around so submission code comes
before completion code. Prior to this, the driver used the
traditional open(), close(), read(), write(), ioctl() ordering
however in this case that places completion code (i.e.
sg_read()) before submission code (i.e. sg_write()). The m
Move user interface part of scsi/sg.h into the new header file:
include/uapi/scsi/sg.h . Since scsi/sg.h includes the new header,
other code including scsi/sg.h should not be impacted.
Signed-off-by: Douglas Gilbert
---
include/scsi/sg.h | 268 ++---
include/uapi
Replace SCSI_LOG_TIMEOUT macros with SG_LOG macros across the driver.
The definition of SG_LOG calls SCSI_LOG_TIMEOUT if given and derived
pointers are non-zero, calls pr_info otherwise. SG_LOGS additionally
prints the sg device name and the thread id. The thread id is very
useful, even in single t
Remove the fixed size array of 16 request elements per file
descriptor and replace with two linked lists per file descriptor.
One list is for active commands, the other list is a free list.
sg_request objects are now kept, available for re-use, until
their owning file descriptor is closed. The sg_r
The internal struct sg_comm_wr_t was added when the number of
arguments to sg_common_write() became excessive. Expand this idea
so multiple calls to sg_fetch_cmnd() can be deferred until a
scsi_request object is ready to receive the command. This saves
a 252 byte stack allocation on every submit pa
Hi,
Thanks for your report!
On Thu, Jul 25, 2019 at 06:46:29PM +0800, kernel test robot wrote:
> FYI, we noticed the following commit (built with gcc-7):
>
> commit: ae86a1c5530b52dc44a280e78feb0c4eb2dd8595 ("[PATCH V2 2/2] scsi:
> implement .cleanup_rq callback")
> url:
> https://github.com/0
On Fri, Jul 26, 2019 at 06:20:46PM +0200, Benjamin Block wrote:
> Hey Ming Lei,
>
> On Sat, Jul 20, 2019 at 11:06:35AM +0800, Ming Lei wrote:
> > Hi,
> >
> > When one request is dispatched to LLD via dm-rq, if the result is
> > BLK_STS_*RESOURCE, dm-rq will free the request. However, LLD may allo
Zdravstvujte! Vas interesuyut klientskie bazy dannyh?
On 7/26/19 9:07 AM, Himanshu Madhani wrote:
static void qla24xx_abort_sp_done(void *ptr, int res)
@@ -109,7 +122,8 @@ static void qla24xx_abort_sp_done(void *ptr, int res)
srb_t *sp = ptr;
struct srb_iocb *abt = &sp->u.iocb_cmd;
- if (del_timer(&sp->u.iocb_cmd.timer)) {
+
On 7/26/19 11:03 AM, James Bottomley wrote:
I don't disagree, but nothing in this patch set actually uses it ... is
there a plan for something to use the scsi_target_block return value to
perform some action other than issue a warning? If not, it likely
makes better sense simply to add the warn
On Fri, 2019-07-26 at 11:00 -0700, Bart Van Assche wrote:
> On 7/26/19 10:00 AM, James Bottomley wrote:
> > On Fri, 2019-07-26 at 09:48 -0700, Bart Van Assche wrote:
> > > If scsi_target_block() fails that can break the code that calls
> > > this
> > > function. Hence complain loudly if scsi_target
On 7/26/19 10:00 AM, James Bottomley wrote:
On Fri, 2019-07-26 at 09:48 -0700, Bart Van Assche wrote:
If scsi_target_block() fails that can break the code that calls this
function. Hence complain loudly if scsi_target_block() fails.
Cc: Christoph Hellwig
Cc: Hannes Reinecke
Cc: Johannes Thums
On Fri, 2019-07-26 at 09:48 -0700, Bart Van Assche wrote:
> If scsi_target_block() fails that can break the code that calls this
> function. Hence complain loudly if scsi_target_block() fails.
>
> Cc: Christoph Hellwig
> Cc: Hannes Reinecke
> Cc: Johannes Thumshirn
> Cc: Ming Lei
> Signed-off-
Hi Martin,
The patches in this series improve the robustness of SCSI device blocking and
unblocking and fix a boot failure. Please consider these patches for kernel
version v5.4.
Thanks,
Bart.
Bart Van Assche (4):
Make scsi_internal_device_unblock_nowait() reject invalid new_state
values
Since scsi_target_block() can fail, return a value that indicates whether
or not this function succeeded.
Cc: Christoph Hellwig
Cc: Hannes Reinecke
Cc: Johannes Thumshirn
Cc: Ming Lei
Signed-off-by: Bart Van Assche
---
drivers/scsi/scsi_lib.c| 24 +---
include/scsi/sc
The only 'new_state' values passed by upstream kernel code to
scsi_internal_device_unblock_nowait() are SDEV_RUNNING and
SDEV_TRANSPORT_OFFLINE. These are the only values that should be passed
to this function. Hence Check the value of the 'new_state' argument
to avoid that scsi_internal_device_unb
The data structure used for log messages is so large that it can cause a
boot failure. Since allocations from that data structure can fail anyway,
use kmalloc() / kfree() instead of that data structure.
See also https://bugzilla.kernel.org/show_bug.cgi?id=204119.
See also commit ded85c193a39 ("scs
If scsi_target_block() fails that can break the code that calls this
function. Hence complain loudly if scsi_target_block() fails.
Cc: Christoph Hellwig
Cc: Hannes Reinecke
Cc: Johannes Thumshirn
Cc: Ming Lei
Signed-off-by: Bart Van Assche
---
drivers/scsi/scsi_lib.c | 2 ++
1 file changed,
Attn Dear Atm Card beneficiary.
GOOD NEWS,
This is to inform you that i have paid the delivery fees for your ATM
Master Card
I paid it because our bank director stated that before, they
So contact Dr. William Roberts, Director DHL Courier
Company Benin to receive your delivery ATM Visa Card amount
Hey Ming Lei,
On Sat, Jul 20, 2019 at 11:06:35AM +0800, Ming Lei wrote:
> Hi,
>
> When one request is dispatched to LLD via dm-rq, if the result is
> BLK_STS_*RESOURCE, dm-rq will free the request. However, LLD may allocate
> private data for this request, so this way will cause memory leak.
I a
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_version.h
b/drivers/scsi/qla2xxx/qla_version.h
index cd6bdf71e533..0833546a1b43 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++
From: Quinn Tran
A hange was observed in the fcport delete path when the
device was responding slow and a issue-lip path (results
in session termination) was taken.
Fix this by issuing logo requests unconditionally.
PID: 19491 TASK: 8e23e67bb150 CPU: 0 COMMAND: "kworker/0:0"
#0 [8e
From: Quinn Tran
Current driver report dev_loss_tmo to 0 for NVME devices
with short cable pull. This causes NVME controller to be freed
along with NVME namespace. The side affect is IO would stop.
By not setting dev_loss_tmo to 0, NVME namespace would stay
until cable is plug back in. This al
From: Andrew Vasquez
Leverage the generic routine, qla24xx_update_fw_options(), for the
configuration of firmware options for ISP27xx/ISP28xx.
Signed-off-by: Andrew Vasquez
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_os.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Quinn Tran
For target mode, the default number of Q-Pairs allowed
to use is 2. If the number of Q-Pair allocated is
lower than the default Q-Pairs, then lower value should
be the set as default.
Signed-off-by: Quinn Tran
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_targe
From: Quinn Tran
Firmware dump captured during LOOP Init error does not yield
any significant information. This patch removes call to
trigger firmware dump collection during Loop Initialization.
Signed-off-by: Quinn Tran
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_isr.c | 1
From: Quinn Tran
Reject eh_{abort|device_reset|target_reset}, when rport is
being torn down or chip is down.
Signed-off-by: Quinn Tran
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_os.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/drivers/scsi/qla2xxx/qla_os.c b
From: Arun Easi
The following sequence of event leads to NVME port disappearing:
- device port shut
- nvme_fc_unregister_remoteport
- device port online
- remote port delete completes
- relogin is scheduled
- "post gidpn" message appears due to rscn generation # mismatch
From: Quinn Tran
when fabric scan thread encounters IOCB Q Full, schedule
a delayed work to retry fabric scan.
Signed-off-by: Quinn Tran
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_gs.c | 28 ++--
1 file changed, 22 insertions(+), 6 deletions(-)
diff
From: Quinn Tran
For any qla2xxx async command, the SRB buffer is used to send
it. In setting up the SRB buffer, the timer for this command
is started before all memory allocation has finished. Under
low memory pressure, memory alloc can go to sleep and not wake
up before the timer expires. Once
From: Andrew Vasquez
Current code misses or fails to account for proper recovery during early
initialization failures:
- Properly unwind allocations during probe() failures.
- Protect against non-initialization memory allocations during
unwinding.
- Propagate error status during HW initializat
From: Quinn Tran
Relogin fail to move forward due scan_state flag indicate
device is not there. Before relogin process, Session delete
process accidently modified the scan_state flag.
Fixes: 79140e2f4fa7 ("scsi: qla2xxx: Fix login state machine freeze")
Cc: sta...@vger.kernel.org
Signed-off-by:
From: Quinn Tran
If an abort times out, the Abort IOCB completion and Abort
timer can race against each other. This patch provides
unique error code for timer path to allow proper cleanup
Signed-off-by: Quinn Tran
Signed-off-by: Himanshu Madhani
---
drivers/scsi/qla2xxx/qla_def.h | 1 +
dri
From: Quinn Tran
[ 17.177276] qla2xxx :05:00.0: DMA-API: device driver frees DMA memory
with different size [device address=0x0006198b] [map size=32784
bytes]
[unmap size=8208 bytes]
[ 17.177390] RIP: 0010:check_unmap+0x7a2/0x1750
[ 17.177425] Call Trace:
[ 17.177438]
With debug kernel we see following wanings indicating memory leak.
[28809.523959] WARNING: CPU: 3 PID: 6790 at lib/dma-debug.c:978
dma_debug_device_change+0x166/0x1d0
[28809.523964] pci :0c:00.6: DMA-API: device driver has pending DMA
allocations while released from device [count=5]
[28809.523
Hi Martin,
This series contains bug fixes for the driver. Most of the fixes are obvious
memory
leak and/or error handling fixes.
Please apply this series to 5.4/scsi-queue at your earliest convenience.
Thanks,
Himanshu
Andrew Vasquez (2):
qla2xxx: Correct error handling during initializati
On Fri, Jul 26, 2019 at 06:00:57AM -0400, Suganath Prabu wrote:
> Although SAS3 & SAS3.5 IT HBA controllers support
> 64-bit DMA addressing, as per hardware design,
> DMA address with all 64-bits set (0x-)
> results in a firmware fault.
Linux will never send a dma address with all
Although SAS3 & SAS3.5 IT HBA controllers support
64-bit DMA addressing, as per hardware design,
DMA address with all 64-bits set (0x-)
results in a firmware fault.
Fix:
Driver will set 63-bit DMA mask to ensure the above address
will not be used.
Cc:
Signed-off-by: Suganath Prab
On Fri, Jul 26, 2019 at 06:00:57AM -0400, Suganath Prabu wrote:
> Although SAS3 & SAS3.5 IT HBA controllers support
> 64-bit DMA addressing, as per hardware design,
> DMA address with all 64-bits set (0x-)
> results in a firmware fault.
>
> Fix:
> Driver will set 63-bit DMA mask to
Although SAS3 & SAS3.5 IT HBA controllers support
64-bit DMA addressing, as per hardware design,
DMA address with all 64-bits set (0x-)
results in a firmware fault.
Fix:
Driver will set 63-bit DMA mask to ensure the above address
will not be used.
Signed-off-by: Suganath Prabu
--
On Fri, Jul 26, 2019 at 12:22 PM Dan Carpenter wrote:
>
> There is a copy and paste bug here. It uses EVENT_TRIGGERS size instead
> of SCSI_TRIGGERS size but fortunately both size are 84 bytes so it
> doesn't affect runtime.
>
> These days the prefered style is to just say sizeof(object) instead
This patch provides the module parameter and sysfs interface to switch
between the firmware provided (optimal) queue depth and controller
queue depth (can_queue).
Although We have sysfs interface per sdev to change the queue depth
of individual scsi devices this implementation provides the single
56 matches
Mail list logo