linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Trent George <trent@norwalkdist.com>
Cc: linux-ide@vger.kernel.org
Subject: Re: dvd-r detection problem with port multiplier
Date: Wed, 27 Sep 2006 10:36:05 +0900	[thread overview]
Message-ID: <4519D585.5010604@gmail.com> (raw)
In-Reply-To: <KMS--2047072133-2724@mail.norwalkdist.com>

Hello, Trent.

Trent George wrote:
> Hi Tejun,
> 
> Well after 2 days and nights of trying to hack into the driver to figure what is my problem....
> 
> I have a fix for me, and an explanation
> The problem seemed related to a pioneer drive and bridgeboard

I have one px716-sa (embedded bridge board), several PATA odds and an 
external simg bridge board.  All of them work okay with the current code.

> I modified sata_sil24.c with the following addition
> 
> in the sil24_do_softreset funtion:
> 
> +	void __iomem *port = (void __iomem *)ap->ioaddr.cmd_addr;
> 
> 	/* put the port into known state */
> 	if (sil24_init_port(ap)) {
> 		reason ="port not ready";
> 		goto err;
> 	}
> 
> +	ata_wait_register(port + PORT_CTRL_STAT, 0x1f0000,
> +		x1f0000, 10, 2000);
> +	
> 	/* do SRST */
> 	ata_tf_init(link->device, &tf);	/* doesn't really matter */
> 
> this will wait until the "active slot" of the "port status" field changes from the port mulitpler pmp id of 0x1f (still executing previous command)
> it seemed there was a delay from 12 to 84 jiffies for this to clear.
> everything works perfect for me now.

That's interesting.  I guess that's from sil24_clear_pmp().  Maybe that 
function needs to wait for active slot to change after clearing each 
port's error condition.  Hmm.. wasn't in the spec though.

> sorry I dont know how to post a patch using the correct method.
> and I know this is not the "correct" fix, but it is the essence of what needs to be done. This will probablly fix the issue of mixing ATAPI and ATA devices, slow devices or bridgeboards causing reset cycling, and using or not the pmp port 0

So, you're saying that this is the same problem which causes reset 
failures if port 0 is unoccupied?  That's great.  Thanks a lot for 
tracking this problem down.

> ps: I used this ugly code to see what was happening:
> ------------
> 	tmp0 = ata_wait_register(port + PORT_CTRL_STAT,	PORT_CS_RDY,
> 		0, 10, 10);
> 	tmp1 = jiffies;
> 	tmp = ata_wait_register(port + PORT_CTRL_STAT,	0x1f0000,
> 		0x1f0000, 10, 1000);
> 	ata_link_printk(link, KERN_ERR, "wait for ready on pmp %d %x %x %d\n ", pmp, tmp0, tmp, jiffies-tmp1);
> --------------

Pretty enough.  :-)  I'll investigate into sil24_clear_pmp() and try to 
merge your fix.

Thanks.

-- 
tejun

  reply	other threads:[~2006-09-27  1:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-27  0:22 dvd-r detection problem with port multiplier Trent George
2006-09-27  1:36 ` Tejun Heo [this message]
2006-09-27  2:37   ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2006-09-27  6:58 Trent George
2006-09-27  7:24 ` Tejun Heo
2006-10-17  4:49   ` Tejun Heo
2006-09-25 17:38 Trent George
2006-09-26  6:14 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4519D585.5010604@gmail.com \
    --to=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=trent@norwalkdist.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).