2008-10-16 03:30:16

by gshan

[permalink] [raw]
Subject: how to limit number of sectors each time

Hi All,

I want to limit requested sectors each time in function
drivers/ide/ide-disk.c::__ide_do_rw_disk. The requested
sectors were defined in rq->nr_sectors. So how to limit or decrease
nr_sectors for data transfer each time?

Thanks in advance,
Gavin


2008-10-16 05:44:55

by Jens Axboe

[permalink] [raw]
Subject: Re: how to limit number of sectors each time

On Thu, Oct 16 2008, gshan wrote:
> Hi All,
>
> I want to limit requested sectors each time in function
> drivers/ide/ide-disk.c::__ide_do_rw_disk. The requested
> sectors were defined in rq->nr_sectors. So how to limit or decrease
> nr_sectors for data transfer each time?

Set max_sectors_kb in sysfs for that device or q->max_sectors
internally.

--
Jens Axboe

2008-10-16 06:21:49

by gshan

[permalink] [raw]
Subject: Re: how to limit number of sectors each time


> (please never send out html only emails, it's considered very bad style
> on this list)
>
> Sounds like you need a quirk/blacklist entry for that drive, if it
> doesn't support 0x00 as meaning 256 sectors. If you are using libata,
> you can add a ATA_HORKAGE_MAX_SEC_128 entry to ata_device_blacklist[] in
> drivers/ata/libata-core.c
>
I'm using IDE driver instead of HD driver.

2008-10-16 06:25:56

by Jens Axboe

[permalink] [raw]
Subject: Re: how to limit number of sectors each time

On Thu, Oct 16 2008, gshan wrote:
>
> >(please never send out html only emails, it's considered very bad style
> >on this list)
> >
> >Sounds like you need a quirk/blacklist entry for that drive, if it
> >doesn't support 0x00 as meaning 256 sectors. If you are using libata,
> >you can add a ATA_HORKAGE_MAX_SEC_128 entry to ata_device_blacklist[] in
> >drivers/ata/libata-core.c
> >
> I'm using IDE driver instead of HD driver.

Then I'm sure Bart can help you out (CC'ed).

--
Jens Axboe

2008-10-16 06:29:29

by gshan

[permalink] [raw]
Subject: Re: how to limit number of sectors each time


>> I'm using IDE driver instead of HD driver.
>>
I dumped out IO registers and PRD table. Note that
maxinum allowed sector number has been decreased
from 256 to 32.

hdc: dma_timer_expiry: dma status == 0x21
========IDE Register DUmp========
DMA start sector: 0x007d5fb5
DMA sectors : 0x0020
Data Reg : 0x00
Error Reg : 0x00
Nsector Reg : 0x19
Sector Reg : 0xbc
LCYL Reg : 0x5f
HCYL Reg : 0x7d
Select Reg : 0xe0
Status Reg : 0x58
Control Reg : 0x58
IRQ Reg : 0x58
======Physical Region Descriptor=======
Base_PRD: 0x0189f000 Current_PRD: 0x0189f008 Entries:3
index=0 base=0x00204d1c lengh=0x00100000
index=1 base=0x00604c1c lengh=0x00200000
index=2 base=0x00304d1c lengh=0x00100080

Subject: Re: how to limit number of sectors each time


[ added linux-ide@ to cc:, please use it for ATA questions ]

On Thursday 16 October 2008, gshan wrote:
>
> > (please never send out html only emails, it's considered very bad style
> > on this list)
> >
> > Sounds like you need a quirk/blacklist entry for that drive, if it
> > doesn't support 0x00 as meaning 256 sectors. If you are using libata,
> > you can add a ATA_HORKAGE_MAX_SEC_128 entry to ata_device_blacklist[] in
> > drivers/ata/libata-core.c
> >
> I'm using IDE driver instead of HD driver.

Then you need to add check for this device to ide_disk_setup()
(prior to blk_queue_max_sectors() call) in drivers/ide/ide-disk.c.

Thanks,
Bart