From: Brian King <brking@us.ibm.com>
To: brking@us.ibm.com
Cc: Jeff Garzik <jgarzik@pobox.com>,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: [PATCH 1/2] libata: Remove dependence on host_set->dev for SAS
Date: Mon, 24 Oct 2005 17:19:17 -0500 [thread overview]
Message-ID: <435D5DE5.7010306@us.ibm.com> (raw)
In-Reply-To: <435D5D83.1060201@us.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 0 bytes --]
[-- Attachment #2: libata_host_set_dev.patch --]
[-- Type: text/plain, Size: 2970 bytes --]
Remove some of the dependence on the host_set struct
in preparation for supporting SAS HBAs. Adds a struct device
pointer to the ata_port struct.
This patch depends on the qc_transport patch:
http://marc.theaimsgroup.com/?l=linux-ide&m=112845939215286&w=2
Signed-off-by: Brian King <brking@us.ibm.com>
---
linux-2.6-bjking1/drivers/scsi/libata-core.c | 13 +++++++------
linux-2.6-bjking1/include/linux/libata.h | 1 +
2 files changed, 8 insertions(+), 6 deletions(-)
diff -puN include/linux/libata.h~libata_host_set_dev include/linux/libata.h
--- linux-2.6/include/linux/libata.h~libata_host_set_dev 2005-10-24 15:04:22.000000000 -0500
+++ linux-2.6-bjking1/include/linux/libata.h 2005-10-24 15:04:22.000000000 -0500
@@ -315,6 +315,7 @@ struct ata_port {
struct ata_host_stats stats;
struct ata_host_set *host_set;
+ struct device *dev;
struct work_struct packet_task;
diff -puN drivers/scsi/libata-core.c~libata_host_set_dev drivers/scsi/libata-core.c
--- linux-2.6/drivers/scsi/libata-core.c~libata_host_set_dev 2005-10-24 15:04:22.000000000 -0500
+++ linux-2.6-bjking1/drivers/scsi/libata-core.c 2005-10-24 15:04:22.000000000 -0500
@@ -2162,9 +2162,9 @@ static void ata_sg_clean(struct ata_queu
DPRINTK("unmapping %u sg elements\n", qc->n_elem);
if (qc->flags & ATA_QCFLAG_SG)
- dma_unmap_sg(ap->host_set->dev, sg, qc->n_elem, dir);
+ dma_unmap_sg(ap->dev, sg, qc->n_elem, dir);
else
- dma_unmap_single(ap->host_set->dev, sg_dma_address(&sg[0]),
+ dma_unmap_single(ap->dev, sg_dma_address(&sg[0]),
sg_dma_len(&sg[0]), dir);
qc->flags &= ~ATA_QCFLAG_DMAMAP;
@@ -2335,7 +2335,7 @@ static int ata_sg_setup_one(struct ata_q
struct scatterlist *sg = qc->sg;
dma_addr_t dma_address;
- dma_address = dma_map_single(ap->host_set->dev, qc->buf_virt,
+ dma_address = dma_map_single(ap->dev, qc->buf_virt,
sg->length, dir);
if (dma_mapping_error(dma_address))
return -1;
@@ -2373,7 +2373,7 @@ static int ata_sg_setup(struct ata_queue
assert(qc->flags & ATA_QCFLAG_SG);
dir = qc->dma_dir;
- n_elem = dma_map_sg(ap->host_set->dev, sg, qc->n_elem, dir);
+ n_elem = dma_map_sg(ap->dev, sg, qc->n_elem, dir);
if (n_elem < 1)
return -1;
@@ -3845,7 +3845,7 @@ err_out:
int ata_port_start (struct ata_port *ap)
{
- struct device *dev = ap->host_set->dev;
+ struct device *dev = ap->dev;
ap->prd = dma_alloc_coherent(dev, ATA_PRD_TBL_SZ, &ap->prd_dma, GFP_KERNEL);
if (!ap->prd)
@@ -3870,7 +3870,7 @@ int ata_port_start (struct ata_port *ap)
void ata_port_stop (struct ata_port *ap)
{
- struct device *dev = ap->host_set->dev;
+ struct device *dev = ap->dev;
dma_free_coherent(dev, ATA_PRD_TBL_SZ, ap->prd, ap->prd_dma);
}
@@ -3937,6 +3937,7 @@ static void ata_host_init(struct ata_por
ap->host = host;
ap->ctl = ATA_DEVCTL_OBS;
ap->host_set = host_set;
+ ap->dev = ent->dev;
ap->port_no = port_no;
ap->hard_port_no =
ent->legacy_mode ? ent->hard_port_no : port_no;
_
next prev parent reply other threads:[~2005-10-24 22:19 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-03 21:56 [RFC 0/2] libata: support SATA devices on SAS HBAs Brian King
2005-10-03 21:58 ` [RFC 1/2] libata: configurable host_set lock Brian King
2005-10-03 21:58 ` [RFC 2/2] libata: support SATA devices on SAS HBAs Brian King
2005-10-04 9:56 ` [RFC 0/2] " Jeff Garzik
2005-10-04 10:22 ` Bartlomiej Zolnierkiewicz
2005-10-04 20:56 ` Bartlomiej Zolnierkiewicz
2005-10-05 20:59 ` Jeff Garzik
2005-10-24 22:17 ` [PATCH " Brian King
2005-10-24 22:19 ` Brian King [this message]
2005-10-25 17:53 ` [PATCH 1/2] libata: Remove dependence on host_set->dev for SAS Jeff Garzik
2005-10-25 19:30 ` Brian King
2005-10-25 19:43 ` Jeff Garzik
2005-10-25 22:48 ` Luben Tuikov
2005-10-27 16:05 ` Brian King
2005-10-27 20:15 ` Luben Tuikov
2005-11-24 0:53 ` Douglas Gilbert
2005-11-24 1:07 ` Jeff Garzik
2005-11-24 8:12 ` Bartlomiej Zolnierkiewicz
2005-12-02 2:05 ` Jeff Garzik
2005-12-02 8:07 ` Bartlomiej Zolnierkiewicz
2005-12-02 10:28 ` Douglas Gilbert
2005-12-02 10:48 ` Jeff Garzik
2005-11-29 22:13 ` Brian King
2005-10-24 22:20 ` [PATCH 2/2] libata: Add support for SATA attachment to SAS adapters Brian King
2005-10-25 17:58 ` Jeff Garzik
2005-10-25 12:59 ` [PATCH 0/2] libata: support SATA devices on SAS HBAs Luben Tuikov
2005-10-25 13:39 ` Brian King
2005-10-25 13:40 ` Luben Tuikov
2005-10-25 13:53 ` Brian King
2005-10-25 14:08 ` Luben Tuikov
2005-10-25 14:27 ` Brian King
2005-10-25 17:51 ` Jeff Garzik
2005-10-25 17:57 ` [RFC " Brian King
2005-10-25 18:07 ` 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=435D5DE5.7010306@us.ibm.com \
--to=brking@us.ibm.com \
--cc=bzolnier@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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).