On Fri, May 06, 2011 at 10:52:19AM -0700, Matthew Dempsky wrote:
> If you have a sili(4) or ahci(4), I'd appreciate a quick test of the
> diff below. As long as you can still mount your disks without
> panicking, then it worked. :)
>
> One test for each is sufficient, so please reply to the list to save
> others from redundant effort.
Works fine with this on amd64:
ahci1 at pci0 dev 17 function 0 "ATI SBx00 SATA" rev 0x00: apic 4 int 22, AHCI
1.1
Cheers,
Jasper
> Index: ata/atascsi.c
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ata/atascsi.c,v
> retrieving revision 1.104
> diff -u -p -r1.104 atascsi.c
> --- ata/atascsi.c 5 May 2011 19:23:05 -0000 1.104
> +++ ata/atascsi.c 6 May 2011 17:41:20 -0000
> @@ -1590,10 +1590,12 @@ atascsi_io_get(void *cookie)
> void
> atascsi_io_put(void *cookie, void *io)
> {
> - struct ata_xfer *xa = io;
> + struct atascsi_host_port *ahp = cookie;
> + struct atascsi *as = ahp->ahp_as;
> + struct ata_xfer *xa = io;
>
> xa->state = ATA_S_COMPLETE; /* XXX this state machine is dumb */
> - xa->ata_put_xfer(xa);
> + as->as_methods->ata_put_xfer(xa);
> }
>
> void
> Index: ata/atascsi.h
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ata/atascsi.h,v
> retrieving revision 1.45
> diff -u -p -r1.45 atascsi.h
> --- ata/atascsi.h 26 Jan 2011 21:41:00 -0000 1.45
> +++ ata/atascsi.h 5 May 2011 19:33:35 -0000
> @@ -18,6 +18,9 @@
> * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> */
>
> +#ifndef _DEV_ATA_ATASCSI_H_
> +#define _DEV_ATA_ATASCSI_H_
> +
> struct atascsi;
> struct scsi_link;
>
> @@ -327,8 +330,6 @@ struct ata_xfer {
> void *atascsi_private;
>
> int pmp_port;
> -
> - void (*ata_put_xfer)(struct ata_xfer *);
> };
>
> /*
> @@ -339,6 +340,7 @@ struct atascsi_methods {
> int (*probe)(void *, int, int);
> void (*free)(void *, int, int);
> struct ata_xfer * (*ata_get_xfer)(void *, int);
> + void (*ata_put_xfer)(struct ata_xfer *);
> void (*ata_cmd)(struct ata_xfer *);
> };
>
> @@ -368,3 +370,5 @@ int atascsi_probe_dev(struct atascsi *,
> int atascsi_detach_dev(struct atascsi *, int, int, int);
>
> void ata_complete(struct ata_xfer *);
> +
> +#endif /* _DEV_ATA_ATASCSI_H_ */
> Index: ic/sili.c
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/ic/sili.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 sili.c
> --- ic/sili.c 26 Jan 2011 21:41:00 -0000 1.47
> +++ ic/sili.c 5 May 2011 19:34:11 -0000
> @@ -211,6 +211,7 @@ struct atascsi_methods sili_atascsi_meth
> sili_ata_probe,
> sili_ata_free,
> sili_ata_get_xfer,
> + sili_ata_put_xfer,
> sili_ata_cmd
> };
>
> @@ -833,7 +834,6 @@ sili_ccb_alloc(struct sili_port *sp)
> ccb->ccb_xa.fis = (struct ata_fis_h2d *)&prb->fis;
> ccb->ccb_xa.packetcmd = ((struct sili_prb_packet *)prb)->cdb;
> ccb->ccb_xa.tag = i;
> - ccb->ccb_xa.ata_put_xfer = sili_ata_put_xfer;
> ccb->ccb_xa.state = ATA_S_COMPLETE;
>
> sili_put_ccb(ccb);
> Index: pci/ahci.c
> ===================================================================
> RCS file: /home/mdempsky/anoncvs/cvs/src/sys/dev/pci/ahci.c,v
> retrieving revision 1.177
> diff -u -p -r1.177 ahci.c
> --- pci/ahci.c 24 Apr 2011 11:09:48 -0000 1.177
> +++ pci/ahci.c 5 May 2011 19:33:58 -0000
> @@ -622,6 +622,7 @@ struct atascsi_methods ahci_atascsi_meth
> ahci_ata_probe,
> ahci_ata_free,
> ahci_ata_get_xfer,
> + ahci_ata_put_xfer,
> ahci_ata_cmd
> };
>
> @@ -1227,8 +1228,6 @@ nomem:
> (struct ata_fis_h2d *)ccb->ccb_cmd_table->cfis;
> ccb->ccb_xa.packetcmd = ccb->ccb_cmd_table->acmd;
> ccb->ccb_xa.tag = i;
> -
> - ccb->ccb_xa.ata_put_xfer = ahci_ata_put_xfer;
>
> ccb->ccb_xa.state = ATA_S_COMPLETE;
> ahci_put_ccb(ccb);
>
--
Cheers,
Jasper
"Capable, generous men do not create victims, they nurture them."