Re: Call for testers, users with scsi cards
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--2547152148-1429842545-1354740996=:4081
Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8BIT
On Wed, 5 Dec 2012, Jim Harris wrote:
>
>
> On Tue, Dec 4, 2012 at 2:36 PM, Jeff Roberson <jroberson@jroberson.net>
> wrote:
> http://people.freebsd.org/~jeff/loadccb.diff
>
> This patch consolidates all of the functions that map cam
> control blocks for DMA into one central function. 糍his change
> is a precursor to adding new features to the I/O stack. 啱t is
> mostly mechanical. 啱f you are running current on a raid or scsi
> card, especially if it is a lesser used one, I would really like
> you to apply this patch and report back any problems. 啱f it
> works you should notice nothing. 啱f it doesn't work you will
> probably panic immediately on I/O or otherwise no I/O will
> happen.
>
>
> +int
> +bus_dmamap_load_ccb(bus_dma_tag_t dmat, bus_dmamap_t map, union ccb *ccb,
> +ꂠꀠꂠꀠꂠꀠbus_dmamap_callback_t *callback, void *callback_arg,
> +ꂠꀠꂠꀠꂠꀠint flags)
> +{
> +ꂠꀠstruct ccb_ataio *ataio;
> +ꂠꀠstruct ccb_scsiio *csio;
> +ꂠꀠstruct ccb_hdr *ccb_h;
> +ꂠꀠvoid *data_ptr;
> +ꂠꀠuint32_t dxfer_len;
> +ꂠꀠuint16_t sglist_cnt;
> +
> +ꂠꀠccb_h = &ccb->ccb_h;
> +ꂠꀠif ((ccb_h->flags & CAM_DIR_MASK) == CAM_DIR_NONE) {
> +ꂠꀠꂠꀠcallback(callback_arg, NULL, 0, 0);
> +ꂠꀠ}
> +
>
> I think you need to return here after invoking the callback.ꀠOtherwise you
> drop through and then either invoke the callback again or call
> bus_dmamap_load (which will in turn invoke the callback again).
>
> This fix allows the ahci.c change to go back to:
>
Thanks Jim. That was silly of me. I have decided to move this work to a
branch and keep expanding on it. I'll solicit more testing once the
branch is closer to the ultimate goal.
Thanks,
Jeff
> Index: sys/dev/ahci/ahci.c
> ===================================================================
> --- sys/dev/ahci/ahci.c (revision 243900)
> +++ sys/dev/ahci/ahci.c (working copy)
> @@ -1667,23 +1667,9 @@
> ꂠꂠꂠꂠꂠꀠ(ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL |
> CAM_ATAIO_NEEDRESULT)))
> ꂠꂠꂠꂠꂠꂠꂠꀠch->aslots |= (1 << slot->slot);
> ꂠꂠꂠꀠslot->dma.nsegs = 0;
> -ꂠꂠꂠ /* If request moves data, setup and load SG list */
> -ꂠꂠꂠ if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
> -ꂠꂠꂠꂠꂠꂠꂠ void *buf;
> -ꂠꂠꂠꂠꂠꂠꂠ bus_size_t size;
> -
> -ꂠꂠꂠꂠꂠꂠꂠ slot->state = AHCI_SLOT_LOADING;
> -ꂠꂠꂠꂠꂠꂠꂠ if (ccb->ccb_h.func_code == XPT_ATA_IO) {
> -ꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠ buf = ccb->ataio.data_ptr;
> -ꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠ size = ccb->ataio.dxfer_len;
> -ꂠꂠꂠꂠꂠꂠꂠ } else {
> -ꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠ buf = ccb->csio.data_ptr;
> -ꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠꂠ size = ccb->csio.dxfer_len;
> -ꂠꂠꂠꂠꂠꂠꂠ }
> -ꂠꂠꂠꂠꂠꂠꂠ bus_dmamap_load(ch->dma.data_tag, slot->dma.data_map,
> -ꂠꂠꂠꂠꂠꂠꂠꂠꂠ buf, size, ahci_dmasetprd, slot, 0);
> -ꂠꂠꂠ } else
> -ꂠꂠꂠꂠꂠꂠꂠ ahci_execute_transaction(slot);
> +ꂠꂠꂠ slot->state = AHCI_SLOT_LOADING;
> +ꂠꂠꂠ bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb,
> +ꂠꂠꂠꂠꂠ ahci_dmasetprd, slot, 0);
>
> ꀊ> ꀯ* Locked by busdma engine. */
>
> This is almost what you head earlier, but adding back setting of the slot's
> state to AHCI_SLOT_LOADING, to cover the case where the load is deferred.ꀊ> It seems OK to do this even in case where no load is actually happening
> (i.e. CAM_DIR_NONE).
>
> -Jim
>
>
>
>
>
>
--2547152148-1429842545-1354740996=:4081
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
--2547152148-1429842545-1354740996=:4081--
討論串 (同標題文章)
完整討論串 (本文為第 12 之 12 篇):