Skip to contentSkip to conversation

how to limit number of sectors each time

DISCUSSION gshan 3 participants 6 messages Oct 16, 2008 – Oct 17, 2008 2 messages not in the archive libata

lore
Share & tools
lore

gshan

author
#0 lore raw

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

#1 lore raw
Quoted 6 lines · gshan

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.

Signature · 1 line
Jens Axboe

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw
Quoted 9 lines

(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.

#5 lore raw
Quoted 10 lines · gshan
Quoted 9 lines

(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).

Signature · 1 line
Jens Axboe
author
#6 lore raw
Quoted 3 lines
Quoted 3 lines

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
#7 lore raw
In reply to gshan

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

Quoted 10 lines · gshan
Quoted 9 lines

(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