linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
To: linux-scsi@vger.kernel.org,
	James Bottomley <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
	"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>
Cc: Brian King <brking@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, Ian Munsie <imunsie@au1.ibm.com>,
	Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
	Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
	Christophe Lombard <clombard@linux.vnet.ibm.com>,
	Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Subject: [PATCH 01/14] cxlflash: Set sg_tablesize to 1 instead of SG_NONE
Date: Tue, 15 Nov 2016 17:13:37 -0600	[thread overview]
Message-ID: <1479251617-22707-1-git-send-email-ukrishn@linux.vnet.ibm.com> (raw)
In-Reply-To: <1479251530-22573-1-git-send-email-ukrishn@linux.vnet.ibm.com>

The following Oops is encountered when blk_mq is enabled with the
cxlflash driver:

[ 2960.817172] Oops: Kernel access of bad area, sig: 11 [#5]
[ 2960.817309] NIP  __blk_mq_run_hw_queue+0x278/0x4c0
[ 2960.817313] LR __blk_mq_run_hw_queue+0x2bc/0x4c0
[ 2960.817314] Call Trace:
[ 2960.817320] __blk_mq_run_hw_queue+0x2bc/0x4c0 (unreliable)
[ 2960.817324] blk_mq_run_hw_queue+0xd8/0x100
[ 2960.817329] blk_mq_insert_requests+0x14c/0x1f0
[ 2960.817333] blk_mq_flush_plug_list+0x150/0x190
[ 2960.817338] blk_flush_plug_list+0x11c/0x2b0
[ 2960.817344] blk_finish_plug+0x58/0x80
[ 2960.817348] __do_page_cache_readahead+0x1c0/0x2e0
[ 2960.817352] force_page_cache_readahead+0x68/0xd0
[ 2960.817356] generic_file_read_iter+0x43c/0x6a0
[ 2960.817359] blkdev_read_iter+0x68/0xa0
[ 2960.817361] __vfs_read+0x11c/0x180
[ 2960.817364] vfs_read+0xa4/0x1c0
[ 2960.817366] SyS_read+0x6c/0x110
[ 2960.817369] system_call+0x38/0xb4

The SCSI blk_mq stack assumes that sg_tablesize is always a non-zero
value with scsi_mq_setup_tags() allocating tags using sg_tablesize.
The cxlflash driver currently uses SG_NONE (0) for the sg_tablesize
as the devices it supports are not capable of scatter gather. This
mismatch of values results in the Oops above.

To resolve this issue, sg_tablesize for cxlflash can simply be set
to 1, a value which satisfies the constraints in cxlflash and the
lack of support of SG_NONE in SCSI blk_mq.

Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index b301655..6004860 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -2377,7 +2377,7 @@ static struct scsi_host_template driver_template = {
 	.cmd_per_lun = CXLFLASH_MAX_CMDS_PER_LUN,
 	.can_queue = CXLFLASH_MAX_CMDS,
 	.this_id = -1,
-	.sg_tablesize = SG_NONE,	/* No scatter gather support */
+	.sg_tablesize = 1,	/* No scatter gather support */
 	.max_sectors = CXLFLASH_MAX_SECTORS,
 	.use_clustering = ENABLE_CLUSTERING,
 	.shost_attrs = cxlflash_host_attrs,
-- 
2.1.0

  reply	other threads:[~2016-11-15 23:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-15 23:12 [PATCH 00/14] cxlflash: Fixes, enhancements, cleanup and staging Uma Krishnan
2016-11-15 23:13 ` Uma Krishnan [this message]
2016-11-17 19:20   ` [PATCH 01/14] cxlflash: Set sg_tablesize to 1 instead of SG_NONE Matthew R. Ochs
2016-11-15 23:14 ` [PATCH 02/14] cxlflash: Fix crash in cxlflash_restore_luntable() Uma Krishnan
2016-11-17 19:20   ` Matthew R. Ochs
2016-11-15 23:14 ` [PATCH 03/14] cxlflash: Improve context_reset() logic Uma Krishnan
2016-11-17 19:21   ` Matthew R. Ochs
2016-11-15 23:14 ` [PATCH 04/14] cxlflash: Avoid command room violation Uma Krishnan
2016-11-17 19:36   ` Matthew R. Ochs
2016-11-17 22:30     ` Uma Krishnan
2016-11-15 23:14 ` [PATCH 05/14] cxlflash: Remove unused buffer from AFU command Uma Krishnan
2016-11-15 23:14 ` [PATCH 06/14] cxlflash: Allocate memory instead of using command pool for AFU sync Uma Krishnan
2016-11-15 23:15 ` [PATCH 07/14] cxlflash: Use cmd_size for private commands Uma Krishnan
2016-11-15 23:15 ` [PATCH 08/14] cxlflash: Remove private command pool Uma Krishnan
2016-11-15 23:15 ` [PATCH 09/14] cxlflash: Wait for active AFU commands to timeout upon tear down Uma Krishnan
2016-11-15 23:15 ` [PATCH 10/14] cxlflash: Remove AFU command lock Uma Krishnan
2016-11-15 23:15 ` [PATCH 11/14] cxlflash: Cleanup send_tmf() Uma Krishnan
2016-11-15 23:15 ` [PATCH 12/14] cxlflash: Cleanup queuecommand() Uma Krishnan
2016-11-15 23:16 ` [PATCH 13/14] cxlflash: Migrate IOARRIN specific routines to function pointers Uma Krishnan
2016-11-15 23:16 ` [PATCH 14/14] cxlflash: Migrate scsi command pointer to AFU command Uma Krishnan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479251617-22707-1-git-send-email-ukrishn@linux.vnet.ibm.com \
    --to=ukrishn@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=clombard@linux.vnet.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=manoj@linux.vnet.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=mrochs@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).