From: Lin Ming <ming.m.lin@intel.com>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: "Jörg Sommer" <joerg@alea.gnuu.de>,
"Jeff Garzik" <jgarzik@redhat.com>,
"Sergei Shtylyov" <sshtylyov@mvista.com>,
linux-scsi@vger.kernel.org, linux-ide@vger.kernel.org
Subject: [RESEND PATCH 1/2] scsi_lib: use correct DMA device in __scsi_alloc_queue
Date: Thu, 12 Apr 2012 13:50:38 +0800 [thread overview]
Message-ID: <1334209839-21978-2-git-send-email-ming.m.lin@intel.com> (raw)
In-Reply-To: <1334209839-21978-1-git-send-email-ming.m.lin@intel.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 1429 bytes --]
Currently, __scsi_alloc_queue uses SCSI host's parent device
as DMA device to set segment boundary. But the parent device may not
refer to the DMA device. For example, for ATA disk, SCSI host's parent
device now refers to ATA port.
Since commit d139b9b([SCSI] scsi_lib_dma: fix bug with dma maps on
nested scsi objects), a new field Scsi_Host->dma_dev was introduced
to refer to the real DMA device.
Use ->dma_dev in __scsi_alloc_queue to correctly set segment
boundary.
Bug report: http://marc.info/?l=linux-ide&m=133177818318187&w=2
Reported-and-tested-by: Jörg Sommer <joerg@alea.gnuu.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
drivers/scsi/scsi_lib.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ead6405..5dfd749 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1638,7 +1638,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost,
request_fn_proc *request_fn)
{
struct request_queue *q;
- struct device *dev = shost->shost_gendev.parent;
+ struct device *dev = shost->dma_dev;
q = blk_init_queue(request_fn, NULL);
if (!q)
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-04-12 5:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 5:50 [RESEND PATCH 0/2]: Use correct DMA device in SCSI/libata Lin Ming
2012-04-12 5:50 ` Lin Ming [this message]
2012-04-12 5:50 ` [RESEND PATCH 2/2] libata: Pass correct DMA device to scsi host Lin Ming
2012-04-20 5:17 ` [RESEND PATCH 0/2]: Use correct DMA device in SCSI/libata Lin Ming
2012-04-21 19:52 ` Jeff Garzik
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=1334209839-21978-2-git-send-email-ming.m.lin@intel.com \
--to=ming.m.lin@intel.com \
--cc=JBottomley@parallels.com \
--cc=jgarzik@redhat.com \
--cc=joerg@alea.gnuu.de \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=sshtylyov@mvista.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).