Skip to contentSkip to conversation

struct page to 36 (or 64) bit bus address?

DISCUSSION Alan Cox 3 participants 4 messages Aug 13, 2001

lore
Share & tools
lore

Alan Cox

author
#0 lore raw
Quoted 10 lines

Actually its pretty trivial to resolve that I think. We already follow precisely the right procedure for some other scsi events. So

   	scsi_retry_command(SCpnt);

would map to setting the error and returning.

To make sure we're on the same wave length, are you suggesting this is the kind of thing we'd call in a callback from the PCI DMA support layer?

Well that would be an ugly layer violation, but how about

scsi_retry_command_waitq(SCpnt, &dma_waitq)

?

#1 lore raw

From: Alan Cox <[email protected]>
Date: Mon, 13 Aug 2001 15:09:31 +0100 (BST)

Quoted 3 lines

To make sure we're on the same wave length, are you suggesting this is the kind of thing we'd call in a callback from the PCI DMA support layer?

Well that would be an ugly layer violation, but how about

scsi_retry_command_waitq(SCpnt, &dma_waitq)

?

I don't mean "PCI DMA support layer knows scsi routines to call", rather I mean:

... register_new_scsi_host() ...

	add_notifier(&pci_dma_freespace_notifier, &host->dma_notifier_block);

And net drivers would do something similar, registering something that will do "netdev_wake_queue();" etc.

Also, the DMA support layer must either:

1) require users of it to provide a kernel thread in which to execute these things in the correct context

2) have a kernel thread of it's own to do this

3) or somehow else be able to accept this notification from any kind of execution context

The notifier is capable of happening anywhere, anytime. Right?

Later,
David S. Miller
[email protected]

#2 lore raw
Quoted 28 lines · David S. Miller

From: Alan Cox <[email protected]>
Date: Mon, 13 Aug 2001 15:09:31 +0100 (BST)

Quoted 3 lines

To make sure we're on the same wave length, are you suggesting this is the kind of thing we'd call in a callback from the PCI DMA support layer?

Well that would be an ugly layer violation, but how about

   	scsi_retry_command_waitq(SCpnt, &dma_waitq)

   ?

I don't mean "PCI DMA support layer knows scsi routines to call", rather I mean:

... register_new_scsi_host() ...

	add_notifier(&pci_dma_freespace_notifier, &host->dma_notifier_block);

And net drivers would do something similar, registering something that will do "netdev_wake_queue();" etc.

Also, the DMA support layer must either:

1) require users of it to provide a kernel thread in which to execute these things in the correct context

Quoted 7 lines

2) have a kernel thread of it's own to do this

3) or somehow else be able to accept this notification from any kind of execution context

The notifier is capable of happening anywhere, anytime. Right?

That's the major problem if we ever want to preserve some ordering in the queuing of SCSI IOs. It is not clear to me why a thread may help here. A thread may help if you actually want to thread the queuing and/or if you want to wait on resource. Note that using a thread for the queuing might be a solution for preserving queuing ordering, but it is not the sole solution.

Defunct T10/CAM addresses ordering problems especially during error recovery by a freeze/unfreeze mechanism of device queues handled by SIMs (SIMs are low-level drivers under Linux). Using threads, call-backs or any other evil things on top of this mechanism can be a matter of O/S dependent issues, but it is not the solution of the problem.

Quoted 3 lines

Later,
David S. Miller
[email protected]

Later,
Gérard P. Roudier
[email protected]

:)

#3 lore raw

From: G廨ard Roudier <[email protected]>
Date: Mon, 13 Aug 2001 21:07:50 +0200 (CEST)

That's the major problem if we ever want to preserve some ordering in the queuing of SCSI IOs.

When DMA mapping operation fails, you simply "stop queueing". Queue freezes and nothing new is executed.

DMA wakeup makes you start where you left off. I cannot see any ordering constraints violated by this as a side effect. It is like a "cork" for running scsi commands in the driver.

The purpose of the hypothetical kernel thread is to get out of interrupt context if that is deemed necessary.

It may not be.

Later,
David S. Miller
[email protected] �:.𣳾𤎖忷m賨▎a𪘁b習鮓wm�b嘅��捩滵嶵𪐴�𡟯蔰_�傂n嫑←屹��h膥霅�&�輈蹂z嫡𣚭+��+zfㄑ搬�坍��i����𡟯蔰_霈熝:+v��)舝鷰锭憃�剜𧙕��菈��蟳簏霈�i