linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: Tejun Heo <tj@kernel.org>
Cc: Jeff Garzik <jeff@garzik.org>,
	IDE/ATA development list <linux-ide@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>, Mark Lord <liml@rtr.ca>,
	rob.opensuse.linux@googlemail.com
Subject: Re: [PATCH #upstream-fixes 3/3] pata_hpt366: reimplement mode programming
Date: Wed, 10 Dec 2008 15:01:08 +0300	[thread overview]
Message-ID: <493FAF84.4050006@ru.mvista.com> (raw)
In-Reply-To: <493E28FF.8030402@kernel.org>

Hello.

Tejun Heo wrote:

> Reimplement mode programming logic of pata_hpt366 such that it's
> identical to that of IDE hpt366 driver.  The differences were...
>
> * pata_hpt366 used 0xCFFF8FFFF to mask pio modes and 0x3FFFFFFF dma
>   modes.  IDE hpt366 uses 0xC1F8FFFF for PIO, 0x303800FF for MWDMA and
>   0x30070000 for UDMA.
>   

   Yeah, so it changes only the applicable timing bits for each mode.

> * pata_hpt366 doesn't set 0x08000000 for PIO unless it's already set
>   and always turns it on for MWDMA/UDMA.  IDE hpt366 doesn't bother
>   with the bit.  It always uses what was there.
>   

   This bit (unless you meant 0x80000000 :-) is just reserved, along 
with 2 neigboring lower order bits.

> * IDE hpt366 always clears 0xC0000000.  pata_hpt366 doesn't.
>   

   This was indeed a big mistake. The table values have PIO_MST bit set 
which enables bus mastering support for PIO modes...

> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>   

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Index: work/drivers/ata/pata_hpt366.c
> ===================================================================
> --- work.orig/drivers/ata/pata_hpt366.c
> +++ work/drivers/ata/pata_hpt366.c
[...]
> @@ -222,25 +200,16 @@ static int hpt36x_cable_detect(struct at
>  	return ATA_CBL_PATA80;
>  }
>  
> -/**
> - *	hpt366_set_piomode		-	PIO setup
> - *	@ap: ATA interface
> - *	@adev: device on the interface
> - *
> - *	Perform PIO mode setup.
> - */
> -
> -static void hpt366_set_piomode(struct ata_port *ap, struct ata_device *adev)
> +static void hpt366_set_mode(struct ata_port *ap, struct ata_device *adev,
> +			    u8 mode)
>  {
> +	struct hpt_clock *clocks = ap->host->private_data;
>  	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
> -	u32 addr1, addr2;
> -	u32 reg;
> -	u32 mode;
> +	u32 addr1 = 0x40 + 4 * (adev->devno + 2 * ap->port_no);
> +	u32 addr2 = 0x51 + 4 * ap->port_no;
>   

   Note that ap->port_no can be safely excluded form all the math due to 
single channel per funcion.

MBR, Sergei



  reply	other threads:[~2008-12-10 12:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09  8:13 [PATCH #upstream-fixes 1/3] pata_hpt366: fix cable detection, Tejun Heo
2008-12-09  8:14 ` [PATCH #upstream-fixes 2/3] pata_hpt366: no ATAPI DMA Tejun Heo
2008-12-09  8:14   ` [PATCH #upstream-fixes 3/3] pata_hpt366: reimplement mode programming Tejun Heo
2008-12-10 12:01     ` Sergei Shtylyov [this message]
2008-12-09 10:28   ` [PATCH #upstream-fixes 2/3] pata_hpt366: no ATAPI DMA Alan Cox
2008-12-09  8:15 ` [PATCH #upstream-fixes 1/3] pata_hpt366: fix cable detection, Tejun Heo
2008-12-09 18:50   ` Sergei Shtylyov
2008-12-09 15:14 ` Sergei Shtylyov
2008-12-09 18:56   ` Sergei Shtylyov
2008-12-10  1:58     ` Tejun Heo
2008-12-16 10:41 ` Jeff Garzik
2008-12-16 11:15   ` 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=493FAF84.4050006@ru.mvista.com \
    --to=sshtylyov@ru.mvista.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jeff@garzik.org \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=rob.opensuse.linux@googlemail.com \
    --cc=tj@kernel.org \
    /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).