Patchwork ata2.00: failed to set xfermode (err_mask=0x100),ata2.00: disabled, CD-ROM drive dead

login
register
mail settings
Submitter Tejun Heo
Date March 28, 2010, 11:47 p.m.
Message ID <4BAFEA7A.50904@kernel.org>
Download mbox | patch
Permalink /patch/48795/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Tejun Heo - March 28, 2010, 11:47 p.m.
Hello,

On 03/29/2010 05:01 AM, Robert Hancock wrote:
>> ata2.00: ATAPI: Pioneer CD-ROM ATAPI Model DR-A24X  0102, E1.02, max
>> MWDMA2
>> ata2.00: NOSETXFER but PATA detected - can't skip SETXFER, might
>> malfunction
> 
> Yeah, NOSETXFER doesn't take effect on PATA drives. It could, but it
> would assume that the BIOS has set the right mode which seems rather
> dangerous.

Well, we can issue the command, ignore the error and then check the
correct mode is configured during revalidation.  For now, the
following should show us whether something like that would work.
Stan Hoeppner - March 29, 2010, 12:09 a.m.
Tejun Heo put forth on 3/28/2010 6:47 PM:
> Hello,
> 
> On 03/29/2010 05:01 AM, Robert Hancock wrote:
>>> ata2.00: ATAPI: Pioneer CD-ROM ATAPI Model DR-A24X  0102, E1.02, max
>>> MWDMA2
>>> ata2.00: NOSETXFER but PATA detected - can't skip SETXFER, might
>>> malfunction
>>
>> Yeah, NOSETXFER doesn't take effect on PATA drives. It could, but it
>> would assume that the BIOS has set the right mode which seems rather
>> dangerous.
> 
> Well, we can issue the command, ignore the error and then check the
> correct mode is configured during revalidation.  For now, the
> following should show us whether something like that would work.
> 
> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
> index 4a28420..ca4a50a 100644
> --- a/drivers/ata/libata-core.c
> +++ b/drivers/ata/libata-core.c
> @@ -3446,6 +3446,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>  				       "NOSETXFER but PATA detected - can't "
>  				       "skip SETXFER, might malfunction\n");
>  		err_mask = ata_dev_set_xfermode(dev);
> +		if (err_mask)
> +			ata_dev_printk(dev, KERN_WARNING, "SETXFER failed w/ %x\n",
> +				       err_mask);
> +		err_mask = 0;
>  	}
> 
>  	if (err_mask & ~AC_ERR_DEV)


I'm still using 2.6.32.9.  Is it ok to apply this against 2.6.32.9?
Tejun Heo - March 29, 2010, 12:25 a.m.
On 03/29/2010 09:09 AM, Stan Hoeppner wrote:
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 4a28420..ca4a50a 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -3446,6 +3446,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>>  				       "NOSETXFER but PATA detected - can't "
>>  				       "skip SETXFER, might malfunction\n");
>>  		err_mask = ata_dev_set_xfermode(dev);
>> +		if (err_mask)
>> +			ata_dev_printk(dev, KERN_WARNING, "SETXFER failed w/ %x\n",
>> +				       err_mask);
>> +		err_mask = 0;
>>  	}
>>
>>  	if (err_mask & ~AC_ERR_DEV)
> 
> 
> I'm still using 2.6.32.9.  Is it ok to apply this against 2.6.32.9?

Yeah, that part hasn't changed lately so it should be okay.
Stan Hoeppner - March 29, 2010, 12:26 a.m.
Stan Hoeppner put forth on 3/28/2010 7:09 PM:
> Tejun Heo put forth on 3/28/2010 6:47 PM:
>> Hello,
>>
>> On 03/29/2010 05:01 AM, Robert Hancock wrote:
>>>> ata2.00: ATAPI: Pioneer CD-ROM ATAPI Model DR-A24X  0102, E1.02, max
>>>> MWDMA2
>>>> ata2.00: NOSETXFER but PATA detected - can't skip SETXFER, might
>>>> malfunction
>>>
>>> Yeah, NOSETXFER doesn't take effect on PATA drives. It could, but it
>>> would assume that the BIOS has set the right mode which seems rather
>>> dangerous.
>>
>> Well, we can issue the command, ignore the error and then check the
>> correct mode is configured during revalidation.  For now, the
>> following should show us whether something like that would work.
>>
>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>> index 4a28420..ca4a50a 100644
>> --- a/drivers/ata/libata-core.c
>> +++ b/drivers/ata/libata-core.c
>> @@ -3446,6 +3446,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>>  				       "NOSETXFER but PATA detected - can't "
>>  				       "skip SETXFER, might malfunction\n");
>>  		err_mask = ata_dev_set_xfermode(dev);
>> +		if (err_mask)
>> +			ata_dev_printk(dev, KERN_WARNING, "SETXFER failed w/ %x\n",
>> +				       err_mask);
>> +		err_mask = 0;
>>  	}
>>
>>  	if (err_mask & ~AC_ERR_DEV)
> 
> 
> I'm still using 2.6.32.9.  Is it ok to apply this against 2.6.32.9?

Oh, and do I need to keep the black list entry or get rid of it?
Tejun Heo - March 29, 2010, 12:31 a.m.
On 03/29/2010 09:26 AM, Stan Hoeppner wrote:
>> I'm still using 2.6.32.9.  Is it ok to apply this against 2.6.32.9?
> 
> Oh, and do I need to keep the black list entry or get rid of it?

It doesn't matter.  It has no effect anyway.
Stan Hoeppner - March 29, 2010, 11:20 p.m.
Tejun Heo put forth on 3/28/2010 7:25 PM:
> On 03/29/2010 09:09 AM, Stan Hoeppner wrote:
>>> diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
>>> index 4a28420..ca4a50a 100644
>>> --- a/drivers/ata/libata-core.c
>>> +++ b/drivers/ata/libata-core.c
>>> @@ -3446,6 +3446,10 @@ static int ata_dev_set_mode(struct ata_device *dev)
>>>  				       "NOSETXFER but PATA detected - can't "
>>>  				       "skip SETXFER, might malfunction\n");
>>>  		err_mask = ata_dev_set_xfermode(dev);
>>> +		if (err_mask)
>>> +			ata_dev_printk(dev, KERN_WARNING, "SETXFER failed w/ %x\n",
>>> +				       err_mask);
>>> +		err_mask = 0;
>>>  	}
>>>
>>>  	if (err_mask & ~AC_ERR_DEV)
>>
>>
>> I'm still using 2.6.32.9.  Is it ok to apply this against 2.6.32.9?
> 
> Yeah, that part hasn't changed lately so it should be okay.

This patch seems to have done the trick Tejun.  Thank you.  Device mount and
read access seem to be slower than with the IDE driver.  But given how
little I use the CD-ROM drive this initial impression may not accurately
describe reality.  Here's relevant dmesg entries from the patched kernel:

scsi0 : ata_piix
scsi1 : ata_piix
ata1: PATA max UDMA/33 cmd 0x1f0 ctl 0x3f6 bmdma 0xf000 irq 14
ata2: PATA max UDMA/33 cmd 0x170 ctl 0x376 bmdma 0xf008 irq 15
ata1: port disabled. ignoring.
ata2.00: ATAPI: Pioneer CD-ROM ATAPI Model DR-A24X  0102, E1.02, max MWDMA2
ata2.00: SETXFER failed w/ 100
ata2.00: configured for MWDMA2
scsi 1:0:0:0: CD-ROM            PIONEER  CD-ROM DR-A01S   1.02 PQ: 0 ANSI: 5
sr0: scsi3-mmc drive: 20x/20x xa/form2 cdda tray
Uniform CD-ROM driver Revision: 3.20
sr 1:0:0:0: Attached scsi CD-ROM sr0

Thanks.

Patch

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 4a28420..ca4a50a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3446,6 +3446,10 @@  static int ata_dev_set_mode(struct ata_device *dev)
 				       "NOSETXFER but PATA detected - can't "
 				       "skip SETXFER, might malfunction\n");
 		err_mask = ata_dev_set_xfermode(dev);
+		if (err_mask)
+			ata_dev_printk(dev, KERN_WARNING, "SETXFER failed w/ %x\n",
+				       err_mask);
+		err_mask = 0;
 	}

 	if (err_mask & ~AC_ERR_DEV)