Re: [PATCH] libata: automatically use DMADIR if drive/bridge requires it

2008-02-22 Thread Albert Lee
Tejun Heo wrote: Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir. That's nice, but most SATA devices which need it will tell us about it in their IDENTIFY PACKET response, as bit-15 of word-62 of the returned data (as per ATA7, ATA8 specifications). So for those

Re: [PATCH 02/15] libata: zero xfer length on ATAPI data xfer IRQ is HSM violation

2007-12-05 Thread Albert Lee
Tejun Heo wrote: From: Albert Lee [EMAIL PROTECTED] Treat zero xfer length as HSM violation. While at it, add unlikely()'s to ATAPI ireason and transfer length checks. tj: Formatted patch and added unlikely()'s. Signed-off-by: Albert Lee [EMAIL PROTECTED] Signed-off-by: Tejun Heo

Re: [PATCH 08/15] libata: improve ATAPI draining

2007-12-05 Thread Albert Lee
. This patch fixes ATAPI regressions introduced by setting transfer chunk size to allocation size. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Albert Lee [EMAIL PROTECTED] Acked-by: Albert Lee [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe linux-ide

Re: [PATCH 06/14] libata: improve ATAPI draining

2007-12-04 Thread Albert Lee
. This patch fixes ATAPI regressions introduced by setting transfer chunk size to allocation size. Signed-off-by: Tejun Heo [EMAIL PROTECTED] Cc: Albert Lee [EMAIL PROTECTED] Sorry for the late reply. The new patch looks good. However, I am a little worried about the following code segment

Re: [PATCH 05/13] libata: improve ATAPI draining

2007-11-28 Thread Albert Lee
Tejun Heo wrote: For misc ATAPI commands which transfer variable length data to the host, overflow can occur due to application or hardware bug. Such overflows can be ignored safely as long as overflow data is properly drained. libata HSM implementation has this implemented in

[PATCH 2/2] libata: use ATA_HORKAGE_STUCK_ERR for ATAPI tape drives

2007-11-13 Thread Albert Lee
Per Mark's comments, maybe all ATAPI tape drives need ATA_HORKAGE_STUCK_ERR. This patch applys ATA_HORKAGE_STUCK_ERR for all ATAPI tape drives. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Mark Lord [EMAIL PROTECTED] --- diff -Nrup 01_ide_tape_stuck_err/drivers/ata/libata-core.c

[PATCH 1/2] libata: workaround DRQ=1 ERR=1 for ATAPI tape drives

2007-11-13 Thread Albert Lee
the ERR bit and proceed sending the CDB. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Cc: Mark Lord [EMAIL PROTECTED] --- Revised per Alan, Mark and Tejun's comments. Tested ok with the Seagate STT8000A tape drive. Patch against the libata-dev tree. diff -Nrup

Re: Fix ATAPI transfer lengths causes CD writing regression

2007-11-03 Thread Albert Lee
Tejun Heo wrote: Daniel Drake wrote: Tejun Heo wrote: 4ata2.00: HSM violation: eh_analyze_tf: BUSY|DRQ 3ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen 3ata2.00: cmd a0/00:00:00:0a:00/00:00:00:00:00/a0 tag 0 cdb 0x5a data 10 in 4 res 58/00:02:00:0a:00/00:00:00:00:00/a0

Re: [PATCH 2/2] libata: change the last state of pio read to HSM_ST_IDLE

2007-10-02 Thread Albert Lee
Jeff Garzik wrote: Albert Lee wrote: Patch 2/2: After reading the last pio data block, the HSM is waiting for device to be idle, not waiting for the last interrupt. This patch changes the state after PIO data-in to HSM_ST_IDLE instead of HSM_ST_LAST for accuracy. Signed-off-by: Albert

Re: ATAPI tape drives broken with libata

2007-09-20 Thread Albert Lee
Mark Lord wrote: I can read and write the tape successfully, and the written data matches what is later read back from it. Here's the hack I used. Not ready for mainline, but perhaps it will help Alan or whomever come up with something nice for Jeff. ---

Re: [PATCH 2.6.23-rc3] pata_pdc2027x: PLL detection fixes

2007-08-21 Thread Albert Lee
Sergei Shtylyov wrote: Hello. Mikael Pettersson wrote: Previously I reported that the pata_pdc2027x PLL detection changes in kernel 2.6.22 broke the driver on my PowerMac: pata_pdc2027x: Invalid PLL input clock 1691742kHz, give up! This is followed by a number of errors and speed

[PATCH 2.6.23-rc3] libata: pata_pdc2027x PLL detection minor cleanup

2007-08-20 Thread Albert Lee
Minor cleanup to remove the unneeded rmb()s per Jeff's advice. Also removed the pll_clock 0 check since pll_clock now guaranteed to be = 0 after Mikael's patch. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Tested ok on both x86 and ppc64, together with Mikael's patch. diff -Nrup 01_mikael

Re: [PATCH 2.6.23-rc3] pata_pdc2027x: PLL detection fixes

2007-08-18 Thread Albert Lee
pdc202xx_new.c driver... Acked-by: Albert Lee [EMAIL PROTECTED] -- albert - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2.6.23-rc3] pata_pdc2027x: PLL detection fixes

2007-08-18 Thread Albert Lee
Jeff Garzik wrote: Mikael Pettersson wrote: Previously I reported that the pata_pdc2027x PLL detection changes in kernel 2.6.22 broke the driver on my PowerMac: pata_pdc2027x: Invalid PLL input clock 1691742kHz, give up! This is followed by a number of errors and speed reduction steps

Re: [PATCH 2.6.23-rc3] pata_pdc2027x: PLL detection fixes

2007-08-18 Thread Albert Lee
Jeff Garzik wrote: Albert Lee wrote: The first rmb() is to make sure bccrl is read before bccrlv for later (bccrl = bccrlv) check since both reading the same memory address. That's already guaranteed without the rmb(), AFAICS. Hmm, thanks for the advice. Will remove both rmb()s

Re: unexpected scsi timeout

2007-07-24 Thread Albert Lee
Vasily Averin wrote: Tejun Heo wrote: [cc'ing Albert] Vasily Averin wrote: Tejun, Jeff I've noticed that some scsi commands for DVD-drive attached to pata_via successfully finishes without any delays but reports about TIMEOUT condition. It happens because of ATA_ERR bit is set in status

[PATCH 1/7] libata: remove irq_on from ata_bus_reset() and ata_std_postreset()

2007-07-07 Thread Albert Lee
It seems irq_on() in ata_bus_reset() and ata_std_postreset() are leftover of the EDD reset. Remove them. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 00_libata-dev/drivers/ata/libata-core.c 01_remove_leftover_irqon/drivers/ata/libata-core.c --- 00_libata-dev/drivers/ata/libata

[PATCH 2/7] sata_promise: pdc_freeze() semantic change

2007-07-07 Thread Albert Lee
After checking the current implementations of freeze()/thaw(), it seems only pdc_freeze() does more than simple irq masking. Remove the DMA stop code from pdc_freeze(). Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 01_remove_leftover_irqon/drivers/ata/sata_promise.c

[PATCH 4/7] libata: use freeze/thaw for polling PIO

2007-07-07 Thread Albert Lee
. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Considerations: Polling PIO, the new user of freeze()/thaw(), might have higher calling frequency to freeze()/thaw() than EH. Can current implemention of freeze()/thaw() handle that? We might need more testing on sata_nv, sata_promise, sata_sil

[PATCH 6/7] libata: remove nIEN handling from ata_tf_load()

2007-07-07 Thread Albert Lee
calls irq_on/irq_off explicitly. vsc_intr_mask_update() also removed since now unused. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- The bitmasks used by vsc_intr_mask_update() are different to the bit masks in vsc_irq_on() and vsc_irq_off(). I don't know which one is more correct. Maybe we need

[PATCH 7/7] libata: remove ap-last_ctl

2007-07-07 Thread Albert Lee
() and such mechanism isn't much utilized.) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 06_tf_load_cleanup/drivers/ata/libata-core.c 07_last_ctl_cleanup/drivers/ata/libata-core.c --- 06_tf_load_cleanup/drivers/ata/libata-core.c2007-07-07 10:49:04.0 +0800

Re: [PATCH 0/10] libata: irq_on/off restructuring

2007-07-06 Thread Albert Lee
Tejun Heo wrote: I like the whole series. Just a few nits. * 9 and 10 need to be oen patch. As it currently stands, compile will fail after 9. * Please don't include Patch n/10 in message body. * Add freeze/thaw to all, merge, kill freeze/thaw from all sequence is a bit odd. It

Re: [info] What's in Jeff's libata-dev inbox?

2007-07-04 Thread Albert Lee
Jeff Garzik wrote: I have patches from Alan (pata_sis FIFO whack, pata_dma option), Tejun, Albert and Kristen still to be reviewed. Will get to those on Friday, after the July 4th US holiday.tions(-) Just to be more specific, my to-review inbox contains: Alan: pata_sis FIFO whack,

Re: [PATCH 1/1] ide: pdc202xx_new PLL input clock fix

2007-07-04 Thread Albert Lee
Sergei Shtylyov wrote: Bartlomiej Zolnierkiewicz wrote: typos fixed manually Signed-off-by: Albert Lee [EMAIL PROTECTED] Except for types in description: Said he, while making his own typo. :-) :) -- albert - To unsubscribe from this list: send the line unsubscribe

[PATCH 0/2] libata: minor pio fixes (resend)

2007-07-04 Thread Albert Lee
Minor pio fixes: 1/2: move ata_altstatus() to pio data xfer functions 2/2: change the last state of pio read to HSM_ST_IDLE (The previous remove unneeded ata_altstatus() from ata_hsm_qc_complete() has been accepted.) Patch against the libata-dev tree for your review. - To unsubscribe from this

[PATCH 1/2] libata: move ata_altstatus() to pio data xfer functions

2007-07-04 Thread Albert Lee
Patch 1/2: Move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions like ata_pio_sectors() and atapi_pio_bytes() where it makes more sense. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- atapi_send_cdb() already calls ata_altstatus() inside. This patch makes ata_pio_sectors

[PATCH 0/10] libata: irq_on/off restructuring

2007-07-04 Thread Albert Lee
For ATA, there are two levels of mechanism available to turn irq on/off. - device level: nIEN bit in the control register. This masks INTRQ from the device. - host adapter level: some controller can mask out per-port irq from the host adapter. Currently various parts of libata deal with irq

[PATCH 2/10] libata: add irq_off

2007-07-04 Thread Albert Lee
Patch 2/10: Currently there is -irq_on but no -irq_off. Turning irq off is done via altering the nIEN bit of qc-tf, together with tf_load(). This patch adds -irq_off for symmetry. tf_load() and ata_qc_set_polling() will be fixed/removed in later patches. Signed-off-by: Albert Lee [EMAIL

[PATCH 3/10] libata: implement -irq_off in LLDDs

2007-07-04 Thread Albert Lee
Patch 3/10: Implement the newly added -irq_off in LLDDs. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 02_add_irq_off/drivers/ata/ahci.c 03_add_irq_off_lldd/drivers/ata/ahci.c --- 02_add_irq_off/drivers/ata/ahci.c 2007-07-04 11:26:30.0 +0800 +++ 03_add_irq_off_lldd

[PATCH 5/10] libata: use freeze/thaw for polling

2007-07-04 Thread Albert Lee
now unused. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Considerations: HSM, the new user of freeze()/thaw(), will call freeze()/thaw() in higher frequency than EH. Can current implemention of freeze()/thaw() handle it? diff -Nrup 04_convert_freeze/drivers/ata/libata-core.c

[PATCH 6/10] libata: add freeze/thaw to old EH LLDDs

2007-07-04 Thread Albert Lee
Patch 6/10: Now that HSM polling code path uses freeze()/thaw() regardless of old EH or new EH. Add freeze()/thaw() to old EH LLDDs for the HSM polling code. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 05_convert_hsm_to_freeze/drivers/ata/pata_ixp4xx_cf.c

[PATCH 7/10] libata: pdc_freeze() semantic change

2007-07-04 Thread Albert Lee
Patch 7/10: After checking the current implementations of freeze()/thaw(), it seems only pdc_freeze() do more than simple irq masking. Remove the DMA stop code from pdc_freeze(). Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 06_add_freeze_thaw_to_lldd/drivers/ata/sata_promise.c

[PATCH 8/10] libata: remove writing of tf-ctl from ata_tf_load()

2007-07-04 Thread Albert Lee
off/on. Remove the implicit nIEN handling from ata_tf_load(). Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 07_sata_promise_freeze/drivers/ata/libata-sff.c 08_tfload_cleanup/drivers/ata/libata-sff.c --- 07_sata_promise_freeze/drivers/ata/libata-sff.c 2007-07-04 13:12

[PATCH 9/10] libata: Integrate freeze/thaw with irq_on/off

2007-07-04 Thread Albert Lee
Patch 9/10: irq_on/irq_off are now only wrapped by freeze/thaw (and unused otherwise). We can integrate freeze/thaw with irq_on/irq_off. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- This is for libata-core. The LLDDs will be fixed in the next patch. diff -Nrup 08_tfload_cleanup/drivers/ata

Re: CF flash PATA on libata failure to attach

2007-07-03 Thread Albert Lee
Alan Cox wrote: On Fri, Jun 29, 2007 at 05:34:36PM +1000, Andrew Hall wrote: Further to this the PATA to SATA bridge being used in this case is: http://www.jmicron.com/JM20330.html ..as you will see only PIO and UDMA modes are supported. In which case their microcontroller in the middle

[PATCH 1/1] ide: pdc202xx_new PLL input clock fix

2007-07-02 Thread Albert Lee
(). This patch calls gettimeofday() to mesure the time elapsed and calculate the PLL input clock accordingly. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- (I have the Promise adapter at hand, so it's easier for me to verify.) Attached please find the patch and the test result

[PATCH 2.6.22-rc6] libata: remove reading alt_status from ata_hsm_qc_complete()

2007-06-27 Thread Albert Lee
In ata_hsm_qc_complete(): Calling ata_altstatus() after the qc is completed might race with next qc. Remove it. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Jeff, (Sorry for re-submitting this patch so late.) The unneeded reading of alt_status might cause trouble when another command doing

Re: libata and legacy ide pcmcia failure

2007-06-25 Thread Albert Lee
Robert de Rooy wrote: Albert Lee wrote: Mark Lord wrote: ... Mmm.. I don't know about the first failure there, but after that it gets into the stuck DRQ state which libata makes no attempt to handle at present. It seems the pata_pcmcia driver is using IRQ driven PIO. Maybe

Re: ide/dma not working from 2.6.19 to 2.6.21

2007-06-25 Thread Albert Lee
Alan Cox wrote: Reloading the pata_pdc2027x module then the problem goes away. I guess maybe somehow mdelay() is not as precise as before... It's not the most accurate of things once power management and the like get invovled. HT doesn't help it either. You should have get much more

[PATCH 1/1] libata: pata_pdc2027x PLL input clock fix

2007-06-25 Thread Albert Lee
(). This patch calls gettimeofday() to mesure the time elapsed and calculate the PLL input clock accordingly. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] --- Did more test. For mdelay(100) the usec_elapsed is usually 99287. However, sometimes the usec_elapsed is 118934, longer

Re: libata and legacy ide pcmcia failure

2007-06-24 Thread Albert Lee
Mark Lord wrote: Robert de Rooy wrote: I did another try with libata pcmcia support using 2.6.22-rc5 which already includes the nodata polling fix, in combination with disable-dev_init_param-and-setxfermode-for-CFA.patch and the timing-debug.patch ... Jun 22 13:19:44 localhost

Re: 2.6.22-rc5 libata/ata_piix failure with older CDROM

2007-06-24 Thread Albert Lee
Mikael Pettersson wrote: I tried (again) to convert an Intel i815EP-chipset machine from IDE to libata, but libata still fails to initialise the CDROM on the machine. With 2.6.22-rc5, IDE says: Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed

Re: ide/dma not working from 2.6.19 to 2.6.21

2007-06-24 Thread Albert Lee
Sergei Shtylyov wrote: Hello. Bahadir Balban wrote: I have a PCI Promise TX2 Ultra133 controller with a harddisk on an ARM platform (which is a barebone system with no BIOS). This setup used to work with the old linux-ide drivers on 2.6.19 You were very lucky then bacause actually

[PATCH/RFC 0/9] libata: irq_on/off restructuring

2007-06-14 Thread Albert Lee
For ATA, there are two levels of mechanism available to turn irq on/off. - device level: nIEN bit in the control register. nIEN masks INTRQ from the device. - host adapter level: some controller can mask out per-port irq from the host adapter. Currently various parts of libata deal with irq

[PATCH/RFC 1/9] libata: remove irq_on from ata_bus_reset() and ata_std_postreset()

2007-06-14 Thread Albert Lee
Patch 1/9: It looks the calling of irq_on() in ata_bus_reset() and ata_std_postreset() are leftover of the earlier EDD reset. Remove them. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 00_libata-dev/drivers/ata/libata-core.c 01_remove_leftover_irqon/drivers/ata/libata-core.c

[PATCH/RFC 2/9] libata: add irq_off() for symmetry

2007-06-14 Thread Albert Lee
Patch 2/9: Currently there is irq_on() but no irq_off(). Turning irq off is done via altering the nIEN bit of qc-tf, together with tf_load(). This patch adds irq_off() for symmetry. tf_load() and ata_qc_set_polling() will be fixed/removed in later patches. Signed-off-by: Albert Lee [EMAIL

[PATCH/RFC 3/9] libata: add -irq_off() to LLDDs

2007-06-14 Thread Albert Lee
Patch 3/9: Minor patch to add the newly added -irq_off() to LLDDs. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 02_add_irq_off/drivers/ata/ahci.c 03_add_irq_off_lldd/drivers/ata/ahci.c --- 02_add_irq_off/drivers/ata/ahci.c 2007-06-01 12:08:21.0 +0800

[PATCH/RFC 4/9] libata: call irq_off from bmdma_freeze()

2007-06-14 Thread Albert Lee
Patch 4/9: Minor patch to call irq_off() from bmdma_freeze() to avoid duplicated code. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 03_add_irq_off_lldd/drivers/ata/libata-sff.c 04_convert_freeze/drivers/ata/libata-sff.c --- 03_add_irq_off_lldd/drivers/ata/libata-sff.c

[PATCH/RFC 5/9] libata: use freeze()/thaw() for polling

2007-06-14 Thread Albert Lee
than using the device nIEN bit. Considerations: 1. the semantic of freeze()/thaw() maybe more than irq off/on? 2. HSM, the new user of freeze()/thaw(), will call freeze()/thaw() more frequently than EH. Can current implemention of freeze()/thaw() handle it? Signed-off-by: Albert Lee

[PATCH/RFC 7/9] libata: pdc_freeze() semantic change

2007-06-14 Thread Albert Lee
-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 06_add_freeze_thaw_to_lldd/drivers/ata/sata_promise.c 07_sata_promise_freeze/drivers/ata/sata_promise.c --- 06_add_freeze_thaw_to_lldd/drivers/ata/sata_promise.c 2007-06-11 17:23:47.0 +0800 +++ 07_sata_promise_freeze/drivers/ata

[PATCH/RFC 8/9] libata: remove writing of tf-ctl from ata_tf_load()

2007-06-14 Thread Albert Lee
() are provided. Since EH/HSM now call freeze()/thaw() for irq off/on explicitly. The implicit nIEN handling is removed from ata_tf_load(). The nIEN snoop codes are also removed from sata_vsc. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 07_sata_promise_freeze/drivers/ata/libata

[PATCH/RFC 9/9] libata: remove irq_on/off and rename freeze()/thaw() to irq_on/off

2007-06-14 Thread Albert Lee
Patch 9/9: It seems -irq_on and -irq_off are now only wrapped by freeze()/thaw() and unused elsewhere. This patch - Remove -irq_on and -irq_off. - Rename -freeze and -thaw to irq_on() and irq_off() to be specific. Hopefully the LLDDs need to implement only one irq on/off by either host

[PATCH 0/6] libata: ATA passthru fixes

2007-06-07 Thread Albert Lee
1/6: update protocol numbers 2/6: support PIO multi commands 3/6: map UDMA protocols 4/6: always enforce correct DEV bit 5/6: support ATAPI devices 6/6: update cached device parameters Patch against the libata-dev tree for your review, thanks. - To unsubscribe from this list: send the line

[PATCH 1/6] libata: update protocol numbers

2007-06-07 Thread Albert Lee
Patch 1/6: Update the ATA passthru protocol numbers according to the new spec. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 00_libata-dev/drivers/ata/libata-scsi.c 01_protocol_update/drivers/ata/libata-scsi.c --- 00_libata-dev/drivers/ata/libata-scsi.c 2007-06-01 12:08

[PATCH 2/6] libata: support PIO multi commands

2007-06-07 Thread Albert Lee
Patch 2/6: support the pass through of PIO multi commands. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 01_protocol_update/drivers/ata/libata-scsi.c 02_pio_multi/drivers/ata/libata-scsi.c --- 01_protocol_update/drivers/ata/libata-scsi.c2007-06-07 11:38:50.0

[PATCH 3/6] libata: map UDMA protocols

2007-06-07 Thread Albert Lee
Patch 3/6: Map the ATA passthru UDMA protocols to ATA_PROT_DMA. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Don't know why SAT distinguishs UDMA Data In and UDMA Data Out from DMA. These UDMA protocols only matter for on-the-wire-protocol and are mostly transparent to the software. Anyway

[PATCH 4/6] libata: always enforce correct DEV bit

2007-06-07 Thread Albert Lee
Patch 4/6: Always enforce correct DEV bit since we know which drive the command is targeted. SAT demands to ignore the DEV bit, too. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 03_udma_supp/drivers/ata/libata-scsi.c 04_dev_bit/drivers/ata/libata-scsi.c --- 03_udma_supp/drivers

[PATCH 5/6] libata: support ATAPI devices

2007-06-07 Thread Albert Lee
Patch 5/6: Support ATA passthru to ATAPI devices. Revised based on Mark's patch and Jeff's comments. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Mark Lord [EMAIL PROTECTED] --- After reading Mark's patch, I guess we can safely by-pass the cdb_len check: the ATA_12/ATA_16 are for the libata

[PATCH 6/6] libata: update cached device paramters

2007-06-07 Thread Albert Lee
Patch 6/6: INIT_DEV_PARAMS and SET_MULTI_MODE change the device parameters cached by libata. Re-read IDENTIFY DEVICE info and update the cached device paramters when seeing these commands. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 05_supp_atapi/drivers/ata/libata-scsi.c

[PATCH 0/3] libata: minor pio fixes

2007-06-04 Thread Albert Lee
Minor pio fixes: 1/3: remove unneeded ata_altstatus() from ata_hsm_qc_complete() 2/3: move the ata_altstatus() to pio data xfer functions 3/3: change the last state of pio read to HSM_ST_IDLE Patch against the libata-dev tree for your review. - To unsubscribe from this list: send the line

[PATCH 1/3] libata: remove unneeded ata_altstatus() from ata_hsm_qc_complete()

2007-06-04 Thread Albert Lee
Patch 1/3: In ata_hsm_qc_complete(): Calling ata_altstatus() after the qc completed looks wrong. Remove it. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- After checking, it is leftover of ata_pio_block( ) in 2.6.17-rc5 of the following merge: http://git.kernel.org/?p=linux/kernel/git/jgarzik

[PATCH 2/3] libata: move ata_altstatus() to pio data xfer functions

2007-06-04 Thread Albert Lee
Patch 2/3: Move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions such as ata_pio_sectors() and atapi_pio_bytes() where it makes more sense. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- atapi_send_cdb() already calls ata_altstatus() inside. This patch makes

[PATCH 3/3] libata: change the last state of pio read to HSM_ST_IDLE

2007-06-04 Thread Albert Lee
Patch 3/3: After reading the last pio block, the HSM is waiting for device to be idle, not waiting for the last interrupt. Change the state after PIO data-in to HSM_ST_IDLE instead of HSM_ST_LAST for accuracy. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 02_move_altstatus

[PATCH 1/1] libata: print device model and firmware revision for ATAPI devices

2007-06-04 Thread Albert Lee
For ATA/CFA devices, libata prints out the device model and firmware revision. Do the same for ATAPI devices. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Sometimes the error happens after identify but before the SCSI messages. Knowing the device model and firmware revision could also help

Re: [PATCH 8/8] libata: ack more unsolicited INTRQ

2007-05-17 Thread Albert Lee
Alan Cox wrote: As previously discussed, the possible issue with this patch is: Some ATA/ATAPI devices might be unhappy if the STATUS register is read during data transfer (not sure if this is true or not). (Patch 5/8 doesn't have such issue.) Some older intel eats your disk if you do that.

[PATCH/RFC 0/8] libata: delegate irq driven pio to workqueue (take 2)

2007-05-16 Thread Albert Lee
1/8: fix the ata_altstatus() in ata_hsm_qc_complete() 2/8: move ata_altstatus() from ata_hsm_move() to pio data xfer functions 3/8: change the state after PIO data-in to HSM_ST_IDLE instead of HSM_ST_LAST 4/8: move and reduce locking to the pio data xfer functions 5/8: ack possibly unsolicited irq

[PATCH 1/8] libata: fix the ata_altstatus() in ata_hsm_qc_complete()

2007-05-16 Thread Albert Lee
patch 1/8: In ata_hsm_qc_complete(): Calling ata_altstatus() after the qc completed looks unsafe. Move it to be before completing the qc. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Don't know what the ata_altstatus() is doing here? Anyway, move it to be before ata_qc_complete(). diff -Nrup

[PATCH 2/8] libata: move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions

2007-05-16 Thread Albert Lee
patch 2/8: Move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions, like ata_pio_sectors() and atapi_pio_bytes() that know better if ata_altstatus() is needed. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- atapi_send_cdb() already did ata_altstatus() in itself. This patch

[PATCH 4/8] libata: move and reduce locking to the pio data xfer functions

2007-05-16 Thread Albert Lee
transfer and clearing of the ATA_PFLAG_HSM_WQ flag. - The transfer of head is made to be multiple of 8-bytes such that -data_xfer() could possibly utilize 32-bit pio/mmio. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Cc: Tejun Heo [EMAIL PROTECTED] --- The variable name

[PATCH 5/8] libata: ack unsolicited INTRQ when polling

2007-05-16 Thread Albert Lee
patch 5/8: - Move the ATA_TFLAG_POLLING check from ata_interrupt to ata_host_intr - Ack unsolicited INTRQ if polling and before the HSM accessing the port. (e.g. some device asserts INTRQ even if polling and nIEN = 1.) Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED

[PATCH 6/8] libata: delegate irq driven pio to workqueue

2007-05-16 Thread Albert Lee
patch 6/8: - Delegate irq driven pio to workqueue. - HSM_ST_LAST is kept in the interrupt since this is not CPU intensive. (Mostly for DMA and non-data.) Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Cc: Tejun Heo [EMAIL PROTECTED] --- sata_sil is not changed

[PATCH 7/8] libata: fix ata_port_flush_task() for irq pio delegation

2007-05-16 Thread Albert Lee
7/8: Submitting tasks from ata_host_intr() breaks ata_port_flush_task(). This patch adds code to disable irq pio delegation to ata_port_flush_task(). Irq pio delegation is re-enabled when next qc is issued. Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Tejun Heo [EMAIL PROTECTED] --- Don't know

[PATCH 8/8] libata: ack more unsolicited INTRQ

2007-05-16 Thread Albert Lee
patch 8/8: ack more unsolicited irq Signed-off-by: Albert Lee [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Cc: Mark Lord [EMAIL PROTECTED] Cc: Tejun Heo [EMAIL PROTECTED] --- To address Alan's concern about the unsolicited irq (hopefully), this patch tries to ack irq that happens after HSM

[PATCH/RFC 0/7] libata: push part of irq driven pio to workqueue

2007-05-11 Thread Albert Lee
1/7: set the state after PIO data-in to HSM_ST_IDLE instead of HSM_ST_LAST 2/7: fix the ata_altstatus() in ata_hsm_qc_complete() 3/7: move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions 4/7: move polling idle irq check to ata_host_intr() 5/7: move and reduce locking to the

[PATCH 2/7] libata: move the ata_altstatus() in ata_hsm_qc_complete()

2007-05-11 Thread Albert Lee
patch 2/7: Calling ata_altstatus() after the qc completed looks incorrect. Move it to before the qc is completed. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 01_last_idle/drivers/ata/libata-core.c 02_flush_fix/drivers/ata/libata-core.c --- 01_last_idle/drivers/ata/libata-core.c

[PATCH 3/7] libata: move ata_altstatus() out to the pio data xfer functions

2007-05-11 Thread Albert Lee
patch 3/7: move ata_altstatus() out from ata_hsm_move() to the pio data xfer functions. Functions like ata_pio_sectors() and atapi_pio_bytes() know better if the flush is needed. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 02_flush_fix/drivers/ata/libata-core.c 03_smart_flush

[PATCH 4/7] libata: move polling idle irq check to ata_host_intr()

2007-05-11 Thread Albert Lee
patch 4/7: move the polling idle irq check from ata_interrupt() to ata_host_intr(), where it makes more sense. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 03_smart_flush/drivers/ata/libata-core.c 04_polling_check/drivers/ata/libata-core.c --- 03_smart_flush/drivers/ata/libata

[PATCH 5/7] libata: move and reduce locking to the pio data xfer functions

2007-05-11 Thread Albert Lee
the ATA_PFLAG_HSM_WQ flag Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 04_polling_check/drivers/ata/libata-core.c 05_narrow_lock/drivers/ata/libata-core.c --- 04_polling_check/drivers/ata/libata-core.c 2007-05-11 10:25:09.0 +0800 +++ 05_narrow_lock/drivers/ata/libata-core.c2007

[PATCH 6/7] libata: push part of the irq driven pio out to workqueue

2007-05-11 Thread Albert Lee
patch 6/7: Push part of the irq driven pio out to workqueue. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- It seems this creates new race condition with ata_exec_internal_sg() and EH? diff -Nrup 05_narrow_lock/drivers/ata/libata-core.c 06_irq_wq/drivers/ata/libata-core.c --- 05_narrow_lock

[PATCH 7/7] libata: ack unexpected INTRQ when polling

2007-05-11 Thread Albert Lee
patch 7/7: ack unexpected INTRQ when polling. (Some device asserts INTRQ even if polling and nIEN = 1. http://bugzilla.kernel.org/show_bug.cgi?id=8441) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- diff -Nrup 06_irq_wq/drivers/ata/libata-core.c 07_ack_random_irq/drivers/ata/libata-core.c

Re: [PATCH 4/7] libata: move polling idle irq check to ata_host_intr()

2007-05-11 Thread Albert Lee
Tejun Heo wrote: diff -Nrup 03_smart_flush/drivers/ata/libata-core.c 04_polling_check/drivers/ata/libata-core.c --- 03_smart_flush/drivers/ata/libata-core.c 2007-05-11 10:24:19.0 +0800 +++ 04_polling_check/drivers/ata/libata-core.c2007-05-11 10:25:09.0 +0800 @@

Re: [PATCH 5/7] libata: move and reduce locking to the pio data xfer functions

2007-05-11 Thread Albert Lee
Tejun Heo wrote: Albert Lee wrote: -static void ata_pio_sector(struct ata_queued_cmd *qc, int last) +static void ata_pio_sector(struct ata_queued_cmd *qc, int last, int lock) I think the naming of @lock is a bit confusing here. @clr_hsm_wq or @last_sector, maybe? How about

Re: [PATCH] libata: disable_irq() during polling IDENTIFY (take 2)

2007-05-08 Thread Albert Lee
Tejun Heo wrote: I guess it's about time to listen what Jeff thinks. Albert, if Jeff agrees with pushing HSM or data transfer to workqueue, are you interested in doing that? The HSM is your baby after all. :-) Moving HSM task to the workqueue looks good idea. The mouse cursor of my X

Re: [PATCH] libata: disable_irq() during polling IDENTIFY

2007-05-07 Thread Albert Lee
Tejun Heo wrote: [cc'ing Bartlomiej and Mark, hi] Hello, Albert. Albert Lee wrote: Problem: Kernel got irq 5: nobody cared when using libata + polling IDENTIFY + Promise 20275 adapter + Benq DW1620 drive. Detail message available in bug 8441 (http://bugzilla.kernel.org

Re: [PATCH] libata: disable_irq() during polling IDENTIFY

2007-05-07 Thread Albert Lee
Tejun Heo wrote: Hello, Albert. Albert Lee wrote: Tejun Heo wrote: Also, this is a problem for not only IDENTIFY but all polling commands. Yes, other command might also assert INTRQ during polling. However, for the specific BENQ DW1620 drive, only IDENTIFY_PACKET_DEVICE has such behavior

[PATCH] libata: disable_irq() during polling IDENTIFY

2007-05-06 Thread Albert Lee
DEVICE, even if nIEN = 1. Proposed fix: disable_irq() during polling IDENTIFY to work around, the same as what IDE subsystem does. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Some controller like Intel ICH4 is immune from the problem, with the same kernel and the same Benq DW1620 drive. So

Re: CD problems booting FC7 RC3

2007-04-02 Thread Albert Lee
Stephen Clark wrote: Hi, When trying to boot FC7 RC3 on my HP N5430 laptop I get the following: ... Write protecting the kernel read-only data: 845k input: PS/2 Generic Mouse as /class/input/input2 SCSI subsystem initialized libata version 2.20 loaded. ACPI: Unable to derive IRQ for

[PATCH 0/4] libata: Workaround/fixes for ATAPI devices (take 3)

2007-04-01 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST patch 2/4: Clear tf before doing request sense patch 3/4: Limit max sector to 128 for TORiSAN DVD drives patch 4/4: Limit ATAPI DMA to R/W commands only for TORiSAN DVD drives (patch 2/4 revised per Tejun's advice.) (patch 3/4 revised per Vlad's new test result.)

[PATCH 1/4] libata: reorder HSM_ST_FIRST for easier decoding (take 3)

2007-04-01 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST, such that the task state transition is easier decoded with human eyes. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Patch against libata-dev tree, for your review, thanks. diff -Nrup 00_libata-dev.ori/include/linux/libata.h 01_hsm_st/include/linux/libata.h

[PATCH 2/4] libata: Clear tf before doing request sense (take 3)

2007-04-01 Thread Albert Lee
patch 2/4: Clear tf before doing request sense. This fixes the AOpen 56X/AKH timeout problem. (http://bugzilla.kernel.org/show_bug.cgi?id=8244) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Per Tejun's advice to use result_tf instead. Patch against libata-dev tree, for your review, thanks

[PATCH 3/4] libata: Limit max sector to 128 for TORiSAN DVD drives (take 3)

2007-04-01 Thread Albert Lee
patch 3/4: The TORiSAN drive locks up when max sector == 256. Limit max sector to 128 for the TORiSAN DRD-N216 drives. (http://bugzilla.kernel.org/show_bug.cgi?id=6710) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Revised to use max sector = 128 per Vlad's new test result. Patch against

[PATCH 0/4] libata: Workaround/fixes for ATAPI devices

2007-03-31 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST patch 2/4: Clear tf before doing request sense patch 3/4: Limit max sector to 240 for TORiSAN DVD drives patch 4/4: Limit ATAPI DMA to R/W commands only for TORiSAN DVD drives - To unsubscribe from this list: send the line unsubscribe linux-ide in the body of a

[PATCH 1/4] libata: reorder HSM_ST_FIRST for easier decoding

2007-03-31 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST, such that the task state transition is easier decoded with human eyes. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Patch against libata-dev tree, for your review, thanks. diff -Nrup 00_libata-dev.ori/include/linux/libata.h 01_hsm_st/include/linux/libata.h

[PATCH 2/4] libata: Clear tf before doing request sense

2007-03-31 Thread Albert Lee
patch 2/4: Clear tf before doing request sense. This fixes the AOpen 56X/AKH timeout problem. (http://bugzilla.kernel.org/show_bug.cgi?id=8244) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Patch against libata-dev tree, for your review, thanks. diff -Nrup 01_hsm_st/drivers/ata/libata-eh.c

[PATCH 3/4] libata: Limit max sector to 240 for TORiSAN DVD drives

2007-03-31 Thread Albert Lee
patch 3/4: The TORiSAN drive locks up when max sector == 256. Limit max sector to 240 for TORiSAN DRD-N216 drives. (http://bugzilla.kernel.org/show_bug.cgi?id=6710) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Patch against libata-dev tree, for your review, thanks. diff -Nrup

[PATCH 4/4] libata: Limit ATAPI DMA to R/W commands only for TORiSAN DVD drives

2007-03-31 Thread Albert Lee
patch 4/4: Limit ATAPI DMA to R/W commands only for TORiSAN DRD-N216 DVD-ROM drives (http://bugzilla.kernel.org/show_bug.cgi?id=6710) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- I guess maybe other commands like READ_DVD_STRUCTURE and READ_CD also work under ATAPI DMA, but not confirmed

Re: [PATCH 2/4] libata: Clear tf before doing request sense

2007-03-31 Thread Albert Lee
Tejun Heo wrote: Albert Lee wrote: diff -Nrup 01_hsm_st/drivers/ata/libata-eh.c 02_aopen_rs/drivers/ata/libata-eh.c --- 01_hsm_st/drivers/ata/libata-eh.c2007-03-23 16:56:13.0 +0800 +++ 02_aopen_rs/drivers/ata/libata-eh.c2007-03-31 01:11:01.0 +0800 @@ -991,18

[PATCH 0/4] libata: Workaround/fixes for ATAPI devices (revised)

2007-03-31 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST patch 2/4: Clear tf before doing request sense patch 3/4: Limit max sector to 240 for TORiSAN DVD drives patch 4/4: Limit ATAPI DMA to R/W commands only for TORiSAN DVD drives (patch 2/4 revised per Tejun's advice.) - To unsubscribe from this list: send the line

[PATCH 1/4] libata: reorder HSM_ST_FIRST for easier decoding

2007-03-31 Thread Albert Lee
patch 1/4: Reorder HSM_ST_FIRST, such that the task state transition is easier decoded with human eyes. Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Patch against libata-dev tree, for your review, thanks. diff -Nrup 00_libata-dev.ori/include/linux/libata.h 01_hsm_st/include/linux/libata.h

[PATCH 2/4] libata: Clear tf before doing request sense (revised)

2007-03-31 Thread Albert Lee
patch 2/4: Clear tf before doing request sense. This fixes the AOpen 56X/AKH timeout problem. (http://bugzilla.kernel.org/show_bug.cgi?id=8244) Signed-off-by: Albert Lee [EMAIL PROTECTED] --- Revised per Tejun's advice to use result_tf instead. Patch against libata-dev tree, for your review

  1   2   >