linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Tony Luck <tony.luck@intel.com>
Cc: linux-scsi@vger.kernel.org,
	James Bottomley <JBottomley@Parallels.com>,
	Lin Ming <ming.m.lin@intel.com>
Subject: [PATCH] simscsi breakage in __scsi_alloc_queue()
Date: Fri, 4 May 2012 04:53:13 +0100	[thread overview]
Message-ID: <20120504035313.GR6871@ZenIV.linux.org.uk> (raw)
In-Reply-To: <f570e9ebfaf5eb31a83808ce7c71e574fa716443.1335913478.git.tony.luck@intel.com>

With the current mainline we end up oopsing in __scsi_alloc_queue(), since
host->dma_dev is left NULL.  I'm not sure if this is the right fix, but
it gives the behaviour equivalent to what we used to have before
commit 6f381fa344911d5a234b13574433cf23036f9467 ([SCSI] scsi_lib: use
correct DMA device in __scsi_alloc_queue).  And with that applied the
damn thing appears to work correctly...

Current mainline barfs on dma_set_seg_boundary(dev, shost->dma_boundary),
since dev ends up being NULL.  AFAICS, the same problem affects any
driver that does scsi_add_host(host, NULL) and there are other such
beasts as well, so they probably also need fixing...

Again, I'm not sure that this is the right way to deal with that and I'd
prefer to have it reviewed by SCSI folks before it goes into the tree.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c
index 331de72..fe2b4d0 100644
--- a/arch/ia64/hp/sim/simscsi.c
+++ b/arch/ia64/hp/sim/simscsi.c
@@ -13,6 +13,7 @@
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
+#include <linux/platform_device.h>
 #include <asm/irq.h>
 #include "hpsim_ssc.h"
 
@@ -358,7 +359,7 @@ simscsi_init(void)
 	if (!host)
 		return -ENOMEM;
 
-	error = scsi_add_host(host, NULL);
+	error = scsi_add_host_with_dma(host, NULL, &platform_bus);
 	if (error)
 		goto free_host;
 	scsi_scan_host(host);

       reply	other threads:[~2012-05-04  3:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <f570e9ebfaf5eb31a83808ce7c71e574fa716443.1335913478.git.tony.luck@intel.com>
2012-05-04  3:53 ` Al Viro [this message]
2012-05-04  9:40   ` [PATCH] simscsi breakage in __scsi_alloc_queue() James Bottomley

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=20120504035313.GR6871@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=JBottomley@Parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=tony.luck@intel.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).