All of lore.kernel.org
 help / color / mirror / Atom feed
* Impact of no_lba48{_dma} = 1 ?
@ 2007-02-07  9:56 Steven Scholz
  2007-02-07 11:58 ` Alan
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Scholz @ 2007-02-07  9:56 UTC (permalink / raw)
  To: linux-ide

Hi all,

on our embedded system we connected a HDD via FPGA driectly to the CPU.
And wrote a evry simple IDE driver for it. BAsicly the HDD internbal
registers are just memory mapped. No DMA is supported by the hardware.
But I think it would be capable of 48bit LBA mode (which just means setting
the HOB bit in the device control register of the HDD correctly?)

Now I wonder what the impact of setting

	hwif->no_lba48 = 1;		/* 1 = cannot do LBA48 */
	hwif->no_lba48_dma = 1;		/* 1 = cannot do LBA48 DMA */

would be.

IIUC then no_lba48 would limit the useable size to 130GB?
Will every HDD work with no_lba48 set to 1? Even those which actually
support 48bit LBA?

How about performance impact of

		if (hwif->no_lba48 || hwif->no_lba48_dma)
			hwif->rqsize = 256;
		else
			hwif->rqsize = 65536;

in ide-probe.c ?

Thanks a million for any pointers!

Steven

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07  9:56 Impact of no_lba48{_dma} = 1 ? Steven Scholz
@ 2007-02-07 11:58 ` Alan
  2007-02-07 13:25   ` Steven Scholz
  0 siblings, 1 reply; 12+ messages in thread
From: Alan @ 2007-02-07 11:58 UTC (permalink / raw)
  To: Steven Scholz; +Cc: linux-ide

> And wrote a evry simple IDE driver for it. BAsicly the HDD internbal
> registers are just memory mapped. No DMA is supported by the hardware.
> But I think it would be capable of 48bit LBA mode (which just means setting
> the HOB bit in the device control register of the HDD correctly?)

And not caching stuff wrongly

> 
> Now I wonder what the impact of setting
> 
> 	hwif->no_lba48 = 1;		/* 1 = cannot do LBA48 */
> 	hwif->no_lba48_dma = 1;		/* 1 = cannot do LBA48 DMA */

no_lba48_dma turns off the use of DMA for 48bit commands, the kernel
tries to issue DMA commands where possible but if it cannot issues LBA48
PIO commands (eg for the end part of a disk)

no_lba48 disables LBA48 so you won't be able to access the further parts
of the disk or some newer features.

> would be.
> 
> IIUC then no_lba48 would limit the useable size to 130GB?
> Will every HDD work with no_lba48 set to 1? Even those which actually
> support 48bit LBA?

No guarantees, but you ought to be able to use the first part of the disk
ok.
 
> How about performance impact of
> 
> 		if (hwif->no_lba48 || hwif->no_lba48_dma)
> 			hwif->rqsize = 256;
> 		else
> 			hwif->rqsize = 65536;
> 
> in ide-probe.c ?

Only relevant for DMA really


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 11:58 ` Alan
@ 2007-02-07 13:25   ` Steven Scholz
  2007-02-07 13:53     ` Alan
  0 siblings, 1 reply; 12+ messages in thread
From: Steven Scholz @ 2007-02-07 13:25 UTC (permalink / raw)
  To: Alan; +Cc: linux-ide

Alan,

>> How about performance impact of
>>
>> 		if (hwif->no_lba48 || hwif->no_lba48_dma)
>> 			hwif->rqsize = 256;
>> 		else
>> 			hwif->rqsize = 65536;
>>
>> in ide-probe.c ?
> 
> Only relevant for DMA really

So rqsize is only needed for DMA accesses?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:53     ` Alan
@ 2007-02-07 13:49       ` Sergei Shtylyov
  2007-02-07 14:11         ` Alan
  2007-02-07 13:57       ` Steven Scholz
  1 sibling, 1 reply; 12+ messages in thread
From: Sergei Shtylyov @ 2007-02-07 13:49 UTC (permalink / raw)
  To: Alan; +Cc: Steven Scholz, linux-ide

Hello.

Alan wrote:

>>>Only relevant for DMA really

>>So rqsize is only needed for DMA accesses?

    Not really, it affects both PIO and DMA.

> PIO transfers are sector at a time, or multi-sector up to a usual limit
> of about 16 sectors.

    You're clearly mixing 2 things here. PIO transfers are 1 sectors _per 
interrupt_ or N (usually 16) sectors in the multiple mode. The ANSI specified 
transfer limit is 256 for LBA28 (which fails on some drives), and 65536 with 
LBA48 _per command_.

MBR, Sergei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:25   ` Steven Scholz
@ 2007-02-07 13:53     ` Alan
  2007-02-07 13:49       ` Sergei Shtylyov
  2007-02-07 13:57       ` Steven Scholz
  0 siblings, 2 replies; 12+ messages in thread
From: Alan @ 2007-02-07 13:53 UTC (permalink / raw)
  To: Steven Scholz; +Cc: linux-ide

> > Only relevant for DMA really
> 
> So rqsize is only needed for DMA accesses?

PIO transfers are sector at a time, or multi-sector up to a usual limit
of about 16 sectors.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:53     ` Alan
  2007-02-07 13:49       ` Sergei Shtylyov
@ 2007-02-07 13:57       ` Steven Scholz
  2007-02-07 14:09         ` Sergei Shtylyov
  2007-02-07 14:16         ` Alan
  1 sibling, 2 replies; 12+ messages in thread
From: Steven Scholz @ 2007-02-07 13:57 UTC (permalink / raw)
  To: Alan; +Cc: linux-ide

Alan,

>>> Only relevant for DMA really
>> So rqsize is only needed for DMA accesses?
> 
> PIO transfers are sector at a time, or multi-sector up to a usual limit
> of about 16 sectors.

So again: rqsize does not matter for PIO transfer?

Looking at the lines

	if (hwif->no_lba48_dma && lba48 && dma) {
		if (block + rq->nr_sectors > 1ULL << 28)
			dma = 0;
		else
			lba48 = 0;
	}

in drivers/ide/ide-disk.c. Does that mean that 48bit LBA adressing using the
task_ioreg_t stuff is only used for sector numbers larger 1 << 28?
Thus for small HDDs only LBA28 ist used by

			hwif->OUTB(block, IDE_SECTOR_REG);
			hwif->OUTB(block>>=8, IDE_LCYL_REG);
			hwif->OUTB(block>>=8, IDE_HCYL_REG);

???

Thanks a million!!!!

Steven

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 14:11         ` Alan
@ 2007-02-07 14:03           ` Steven Scholz
  2007-02-07 14:19             ` Alan
  2007-02-07 14:10           ` Sergei Shtylyov
  1 sibling, 1 reply; 12+ messages in thread
From: Steven Scholz @ 2007-02-07 14:03 UTC (permalink / raw)
  To: Alan; +Cc: Sergei Shtylyov, linux-ide

Alan wrote:
> On Wed, 07 Feb 2007 16:49:44 +0300
> Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:
> 
>> Hello.
>>
>> Alan wrote:
>>
>>>>> Only relevant for DMA really
>>>> So rqsize is only needed for DMA accesses?
>>     Not really, it affects both PIO and DMA.
> 
> Yes but its not relevant. The question was about performance, and your
> performance will suck equally with PIO regardless of the request size
> limit.

Ok: I rephrase my question:

Could it be that my HDD behaves strangly (i.e. doing

	hda: status timeout: status=0xd0 { Busy }
	ide: failed opcode was: unknown
	hda: no DRQ after issuing MULTWRITE_EXT
	ide0: unexpected interrupt, status=0x80, count=1
	ide0: reset: success

) sometimes when rqsize is set to 65536 altough I only do PIO transfer?

Steven

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:57       ` Steven Scholz
@ 2007-02-07 14:09         ` Sergei Shtylyov
  2007-02-07 14:16         ` Alan
  1 sibling, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2007-02-07 14:09 UTC (permalink / raw)
  To: Steven Scholz; +Cc: Alan, linux-ide

Hello.

Steven Scholz wrote:

>>>So rqsize is only needed for DMA accesses?

>>PIO transfers are sector at a time, or multi-sector up to a usual limit
>>of about 16 sectors.

> So again: rqsize does not matter for PIO transfer?

> Looking at the lines

> 	if (hwif->no_lba48_dma && lba48 && dma) {
> 		if (block + rq->nr_sectors > 1ULL << 28)
> 			dma = 0;
> 		else
> 			lba48 = 0;
> 	}

> in drivers/ide/ide-disk.c. Does that mean that 48bit LBA adressing using the
> task_ioreg_t stuff is only used for sector numbers larger 1 << 28?

    If you're asking in general, no, that does not follow from that code.
    It only takes care of the no_lba48_dma case.

MBR, Sergei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 14:11         ` Alan
  2007-02-07 14:03           ` Steven Scholz
@ 2007-02-07 14:10           ` Sergei Shtylyov
  1 sibling, 0 replies; 12+ messages in thread
From: Sergei Shtylyov @ 2007-02-07 14:10 UTC (permalink / raw)
  To: Alan; +Cc: Steven Scholz, linux-ide

Hello.

Alan wrote:

>>>>>Only relevant for DMA really

>>>>So rqsize is only needed for DMA accesses?

>>    Not really, it affects both PIO and DMA.

> Yes but its not relevant. The question was about performance, and your
> performance will suck equally with PIO regardless of the request size
> limit.

    Performace would suck even more with the single sector transfers. :-)

> Alan

MBR, Sergei

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:49       ` Sergei Shtylyov
@ 2007-02-07 14:11         ` Alan
  2007-02-07 14:03           ` Steven Scholz
  2007-02-07 14:10           ` Sergei Shtylyov
  0 siblings, 2 replies; 12+ messages in thread
From: Alan @ 2007-02-07 14:11 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Steven Scholz, linux-ide

On Wed, 07 Feb 2007 16:49:44 +0300
Sergei Shtylyov <sshtylyov@ru.mvista.com> wrote:

> Hello.
> 
> Alan wrote:
> 
> >>>Only relevant for DMA really
> 
> >>So rqsize is only needed for DMA accesses?
> 
>     Not really, it affects both PIO and DMA.

Yes but its not relevant. The question was about performance, and your
performance will suck equally with PIO regardless of the request size
limit.

Alan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 13:57       ` Steven Scholz
  2007-02-07 14:09         ` Sergei Shtylyov
@ 2007-02-07 14:16         ` Alan
  1 sibling, 0 replies; 12+ messages in thread
From: Alan @ 2007-02-07 14:16 UTC (permalink / raw)
  To: Steven Scholz; +Cc: linux-ide

On Wed, 07 Feb 2007 14:57:27 +0100
Steven Scholz <steven.scholz@imc-berlin.de> wrote:

> Alan,
> 
> >>> Only relevant for DMA really
> >> So rqsize is only needed for DMA accesses?
> > 
> > PIO transfers are sector at a time, or multi-sector up to a usual limit
> > of about 16 sectors.
> 
> So again: rqsize does not matter for PIO transfer?
> 
> Looking at the lines
> 
> 	if (hwif->no_lba48_dma && lba48 && dma) {
> 		if (block + rq->nr_sectors > 1ULL << 28)
> 			dma = 0;
> 		else
> 			lba48 = 0;
> 	}

This code is for DMA transfers when we need LBA48 and can't do it. The
general code tries to avoid LBA48 commands when possible as they require
two loads of the taskfile which has a performance impact. The old IDE
code didn't use to do this for PIO that I remember but I'd need to
re-read the code in case it ever got changed. If it doesn't its not hard
to add a check for the PIO case.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Impact of no_lba48{_dma} = 1 ?
  2007-02-07 14:03           ` Steven Scholz
@ 2007-02-07 14:19             ` Alan
  0 siblings, 0 replies; 12+ messages in thread
From: Alan @ 2007-02-07 14:19 UTC (permalink / raw)
  To: Steven Scholz; +Cc: Sergei Shtylyov, linux-ide

> 	hda: status timeout: status=0xd0 { Busy }
> 	ide: failed opcode was: unknown
> 	hda: no DRQ after issuing MULTWRITE_EXT
> 	ide0: unexpected interrupt, status=0x80, count=1
> 	ide0: reset: success
> 
> ) sometimes when rqsize is set to 65536 altough I only do PIO transfer?

If your hardware support for LBA48 is broken and you've not disabled
LBA48 then your hardware will do many strange things. 

If however the hwif->no_lba48 is set then drive->addressing ends up as 0
so LBA48 commands should never be issued and rqsize should never get >
256.

Alan

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-02-07 14:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-07  9:56 Impact of no_lba48{_dma} = 1 ? Steven Scholz
2007-02-07 11:58 ` Alan
2007-02-07 13:25   ` Steven Scholz
2007-02-07 13:53     ` Alan
2007-02-07 13:49       ` Sergei Shtylyov
2007-02-07 14:11         ` Alan
2007-02-07 14:03           ` Steven Scholz
2007-02-07 14:19             ` Alan
2007-02-07 14:10           ` Sergei Shtylyov
2007-02-07 13:57       ` Steven Scholz
2007-02-07 14:09         ` Sergei Shtylyov
2007-02-07 14:16         ` Alan

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.