All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <htejun@gmail.com>
To: Felix Domke <tmbinc@elitedvb.net>
Cc: linux-ide@vger.kernel.org
Subject: Re: [patch 5/7] [RFC] xenon: add SATA support
Date: Thu, 08 Mar 2007 16:54:51 +0900	[thread overview]
Message-ID: <45EFC14B.3090906@gmail.com> (raw)
In-Reply-To: <45EF2899.2030508@elitedvb.net>

Hello,

Generally looks good.  Some questions and suggestions follow.

Felix Domke wrote:
> Index: linux-2.6.20/drivers/ata/libata-core.c
> ===================================================================
> --- linux-2.6.20.orig/drivers/ata/libata-core.c	2007-03-07
> 19:01:12.000000000 +0100
> +++ linux-2.6.20/drivers/ata/libata-core.c	2007-03-07 19:01:22.000000000
> +0100
> @@ -1478,7 +1478,7 @@
>  	}
> 
>  	tf.protocol = ATA_PROT_PIO;
> -	tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */
> +//	tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */

Polling IDENTIFY doesn't work for you?  Care to explain how it's broken?

> Index: linux-2.6.20/drivers/ata/sata_xenon.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ linux-2.6.20/drivers/ata/sata_xenon.c	2007-03-07 19:01:22.000000000
> +0100
> +	   Note on the DVD-ROM part:
> +
> +	   The drives usually require some tweaks to be usable under linux.
> +
> +	   You either need to hack the scsi layer, or, in case of the GDR3120L,
> +	   set 'modeB' in the bootloader.

Care to explain it further?  Or is it some cryptic embedded stuff?

> +extern struct ata_probe_ent *ata_probe_ent_alloc(struct device *dev,
> +						 const struct ata_port_info *port);

This is an internal function and if you do this, your driver won't build
as a kernel module.  Please do as other drivers do.  probe_ent is in the
process of being removed, so looking ugly is okay for the time being.

> +static u32 xenon_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg)
> +{
> +	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
> +	unsigned int cfg_addr = get_scr_cfg_addr(ap->port_no, sc_reg,
> pdev->device);
> +	u32 val;
> +
> +	if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */
> +		return 0; /* assume no error */

Interesting, SError isn't there while other regs are?

> +static u32 xenon_scr_read (struct ata_port *ap, unsigned int sc_reg)
> +{
> +	if (sc_reg > SCR_CONTROL)
> +		return 0xffffffffU;
> +
> +	return xenon_scr_cfg_read(ap, sc_reg);
> +}

Just collapse xenon_scr_cfg_read() into xenon_scr_read().

> +static void xenon_scr_write (struct ata_port *ap, unsigned int sc_reg,
> u32 val)
> +{
> +	if (sc_reg > SCR_CONTROL)
> +		return;
> +
> +	xenon_scr_cfg_write(ap, sc_reg, val);
> +}

Ditto for write.

> +static int xenon_init_one (struct pci_dev *pdev, const struct
> pci_device_id *ent)
> +{
> +	static int printed_version;
> +	struct ata_probe_ent *probe_ent = NULL;
> +	int rc;
> +	int pci_dev_busy = 0;
> +
> +	if (!printed_version++)
> +		dev_printk(KERN_INFO, &pdev->dev, "version " DRV_VERSION "\n");
> +
> +	rc = pci_enable_device(pdev);
> +	if (rc)
> +		return rc;

New drivers are generally accepted into libata-dev#upstream branch, and
it looks a bit different in the init path.  If you're a gitter, please
generate patch against libata-dev#upstream, if not the latest -mm should
be good enough.

Thanks.

-- 
tejun

  reply	other threads:[~2007-03-08  7:54 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 18:01 [patch 0/7] [RFC] Xenon support Felix Domke
2007-03-07 18:01 ` [patch 1/7] xenon: add PCI Vendor ID: Microsoft Felix Domke
2007-03-07 18:01 ` [patch 2/7] xenon: add platform support Felix Domke
2007-03-07 23:06   ` Arnd Bergmann
2007-03-07 18:01 ` [patch 3/7] xenon: udbg support (ugly) Felix Domke
2007-03-07 21:00   ` Geert Uytterhoeven
2007-03-07 18:01 ` [patch 4/7] xenon: add southbridge ethernet support Felix Domke
2007-03-07 23:27   ` Arnd Bergmann
2007-03-07 18:01 ` [patch 5/7] xenon: add SATA support Felix Domke
2007-03-07 21:02   ` Sergei Shtylyov
2007-03-07 21:07     ` Felix Domke
2007-03-07 21:14       ` Sergei Shtylyov
2007-03-07 18:01 ` [patch 6/7] xenon: add SMC support Felix Domke
2007-03-07 21:54   ` Arnd Bergmann
2007-03-08 23:29   ` Linas Vepstas
2007-03-07 18:01 ` [patch 7/7] xenon: add framebuffer support (ugly) Felix Domke
2007-03-07 21:03 ` [patch 5/7] [RFC] xenon: add SATA support Felix Domke
2007-03-08  7:54   ` Tejun Heo [this message]
2007-03-09 16:06   ` Jeff Garzik
2007-03-07 21:06 ` [patch 0/7] [RFC] Xenon support Josh Boyer
2007-03-07 21:14   ` Felix Domke
2007-03-08  9:48   ` Benjamin Herrenschmidt
2007-03-08  0:35 ` Stephen Rothwell
2007-03-08  0:52   ` Felix Domke
2007-03-08 11:02   ` Christoph Hellwig
2007-03-08 23:50   ` Linas Vepstas

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=45EFC14B.3090906@gmail.com \
    --to=htejun@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=tmbinc@elitedvb.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.