* question about passing physical address to lower level driver in scsi
@ 2011-10-30 12:05 yoma sophian
2011-10-30 12:28 ` Stefan Richter
0 siblings, 1 reply; 6+ messages in thread
From: yoma sophian @ 2011-10-30 12:05 UTC (permalink / raw)
To: linux-scsi
Dear all:
in scsi_init_sgtable, we create sgtable, sdb->table.sgl, and get the
page from blk_rq_map_sg.
But when the dma_address of sdb->table.sgl will be calclated out
before send the scsi command down to the lower level driver?
Thanks for your help in advance,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about passing physical address to lower level driver in scsi
2011-10-30 12:05 question about passing physical address to lower level driver in scsi yoma sophian
@ 2011-10-30 12:28 ` Stefan Richter
2011-10-31 1:53 ` yoma sophian
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Richter @ 2011-10-30 12:28 UTC (permalink / raw)
To: yoma sophian; +Cc: linux-scsi
On Oct 30 yoma sophian wrote:
> in scsi_init_sgtable, we create sgtable, sdb->table.sgl, and get the
> page from blk_rq_map_sg.
> But when the dma_address of sdb->table.sgl will be calclated out
> before send the scsi command down to the lower level driver?
The low level driver, not SCSI core, is responsible to obtain a DMA
address.
dma_map_sg() maps the scatter-gather list into DMA memory. Then you can
iterate over the list with for_each_sg and obtain DMA handles and lengths
with sg_dma_address() and sg_dma_len(). E.g.:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/firewire/sbp2.c;h=41841a3e3f99c9acd4c4fc72c972626d8dffdcee;hb=02f8c6aee8df3cdc935e9bdd4f2d020306035dbe#l1398
--
Stefan Richter
-=====-==-== =-=- ====-
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about passing physical address to lower level driver in scsi
2011-10-30 12:28 ` Stefan Richter
@ 2011-10-31 1:53 ` yoma sophian
2011-10-31 6:11 ` Julian Calaby
0 siblings, 1 reply; 6+ messages in thread
From: yoma sophian @ 2011-10-31 1:53 UTC (permalink / raw)
To: Stefan Richter; +Cc: linux-scsi
hi stefan:
Thanks for your reply.
2011/10/30, Stefan Richter <stefanr@s5r6.in-berlin.de>:
> On Oct 30 yoma sophian wrote:
>> in scsi_init_sgtable, we create sgtable, sdb->table.sgl, and get the
>> page from blk_rq_map_sg.
>> But when the dma_address of sdb->table.sgl will be calclated out
>> before send the scsi command down to the lower level driver?
>
> The low level driver, not SCSI core, is responsible to obtain a DMA
> address.
Why I ask this because I found there is no same transformation for
scsi usb subsystem.
Would anyone can let me know where it is?
>
> dma_map_sg() maps the scatter-gather list into DMA memory. Then you can
> iterate over the list with for_each_sg and obtain DMA handles and lengths
> with sg_dma_address() and sg_dma_len(). E.g.:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/firewire/sbp2.c;h=41841a3e3f99c9acd4c4fc72c972626d8dffdcee;hb=02f8c6aee8df3cdc935e9bdd4f2d020306035dbe#l1398
> --
> Stefan Richter
> -=====-==-== =-=- ====-
> http://arcgraph.de/sr/
>
Retards,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about passing physical address to lower level driver in scsi
2011-10-31 1:53 ` yoma sophian
@ 2011-10-31 6:11 ` Julian Calaby
2011-10-31 12:22 ` Stefan Richter
0 siblings, 1 reply; 6+ messages in thread
From: Julian Calaby @ 2011-10-31 6:11 UTC (permalink / raw)
To: yoma sophian; +Cc: Stefan Richter, linux-scsi
Hi,
On Mon, Oct 31, 2011 at 12:53, yoma sophian <sophian.yoma@gmail.com> wrote:
> hi stefan:
> Thanks for your reply.
> 2011/10/30, Stefan Richter <stefanr@s5r6.in-berlin.de>:
>> On Oct 30 yoma sophian wrote:
>>> in scsi_init_sgtable, we create sgtable, sdb->table.sgl, and get the
>>> page from blk_rq_map_sg.
>>> But when the dma_address of sdb->table.sgl will be calclated out
>>> before send the scsi command down to the lower level driver?
>>
>> The low level driver, not SCSI core, is responsible to obtain a DMA
>> address.
>
> Why I ask this because I found there is no same transformation for
> scsi usb subsystem.
> Would anyone can let me know where it is?
I am not familiar with the code in question, but I would guess that
this would happen in the USB Controller Interface driver.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about passing physical address to lower level driver in scsi
2011-10-31 6:11 ` Julian Calaby
@ 2011-10-31 12:22 ` Stefan Richter
2011-10-31 12:28 ` yoma sophian
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Richter @ 2011-10-31 12:22 UTC (permalink / raw)
To: Julian Calaby; +Cc: yoma sophian, linux-scsi
On Oct 31 Julian Calaby wrote:
> Hi,
>
> On Mon, Oct 31, 2011 at 12:53, yoma sophian <sophian.yoma@gmail.com> wrote:
> > hi stefan:
> > Thanks for your reply.
> > 2011/10/30, Stefan Richter <stefanr@s5r6.in-berlin.de>:
> >> The low level driver, not SCSI core, is responsible to obtain a DMA
> >> address.
> >
> > Why I ask this because I found there is no same transformation for
> > scsi usb subsystem.
> > Would anyone can let me know where it is?
>
> I am not familiar with the code in question, but I would guess that
> this would happen in the USB Controller Interface driver.
I don't know the USB subsystem either. Anyway, in this case the
"SCSI low-level" (i.e. SCSI transport and interconnect driver)
internally consists of USB high-level (storage), USB core, and USB
low-level (UHCI, EHCI or whatever). "grep -r dma_map_sg drivers/usb/"
shows occurrences of scatter-gather list DMA mappings in the USB core. I
haven't checked whether these are indeed the ones that the usb-storage
driver relies on.
--
Stefan Richter
-=====-==-== =-=- =====
http://arcgraph.de/sr/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: question about passing physical address to lower level driver in scsi
2011-10-31 12:22 ` Stefan Richter
@ 2011-10-31 12:28 ` yoma sophian
0 siblings, 0 replies; 6+ messages in thread
From: yoma sophian @ 2011-10-31 12:28 UTC (permalink / raw)
To: Stefan Richter; +Cc: Julian Calaby, linux-scsi
hi all:
2011/10/31, Stefan Richter <stefanr@s5r6.in-berlin.de>:
> On Oct 31 Julian Calaby wrote:
>> Hi,
>>
>> On Mon, Oct 31, 2011 at 12:53, yoma sophian <sophian.yoma@gmail.com>
>> wrote:
>> > hi stefan:
>> > Thanks for your reply.
>> > 2011/10/30, Stefan Richter <stefanr@s5r6.in-berlin.de>:
>> >> The low level driver, not SCSI core, is responsible to obtain a DMA
>> >> address.
>> >
>> > Why I ask this because I found there is no same transformation for
>> > scsi usb subsystem.
>> > Would anyone can let me know where it is?
>>
>> I am not familiar with the code in question, but I would guess that
>> this would happen in the USB Controller Interface driver.
>
> I don't know the USB subsystem either. Anyway, in this case the
> "SCSI low-level" (i.e. SCSI transport and interconnect driver)
> internally consists of USB high-level (storage), USB core, and USB
> low-level (UHCI, EHCI or whatever). "grep -r dma_map_sg drivers/usb/"
> shows occurrences of scatter-gather list DMA mappings in the USB core. I
> haven't checked whether these are indeed the ones that the usb-storage
> driver relies on.
I will check where you mentioned.
appreciate your kind help,
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-10-31 12:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-30 12:05 question about passing physical address to lower level driver in scsi yoma sophian
2011-10-30 12:28 ` Stefan Richter
2011-10-31 1:53 ` yoma sophian
2011-10-31 6:11 ` Julian Calaby
2011-10-31 12:22 ` Stefan Richter
2011-10-31 12:28 ` yoma sophian
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.