Re: [PATCH 1/5] ata: ahci: add support for non-standard port offset/length

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,

On Fri, Apr 22, 2016 at 04:32:37PM +0200, Thomas Petazzoni wrote:
> @@ -1714,10 +1714,11 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	for (i = 0; i < host->n_ports; i++) {
>  		struct ata_port *ap = host->ports[i];
> +		unsigned int offset =
> +			hpriv->port_offset + ap->port_no * hpriv->port_length;
>  
>  		ata_port_pbar_desc(ap, ahci_pci_bar, -1, "abar");
> -		ata_port_pbar_desc(ap, ahci_pci_bar,
> -				   0x100 + ap->port_no * 0x80, "port");
> +		ata_port_pbar_desc(ap, ahci_pci_bar, offset, "port");

Doesn't this just affect ahci_platform?  Why is ahci_init_one() being
updated?  Also, who's setting port_offet and port_length for
non-platform ahci drivers?

> @@ -556,10 +559,12 @@ int ahci_platform_init_host(struct platform_device *pdev,
>  
>  	for (i = 0; i < host->n_ports; i++) {
>  		struct ata_port *ap = host->ports[i];
> +		unsigned int offset =
> +			hpriv->port_offset + ap->port_no * hpriv->port_length;
>  
>  		ata_port_desc(ap, "mmio %pR",
>  			      platform_get_resource(pdev, IORESOURCE_MEM, 0));
> -		ata_port_desc(ap, "port 0x%x", 0x100 + ap->port_no * 0x80);
> +		ata_port_desc(ap, "port 0x%x", offset);

If this needs to be configurable, wouldn't it be better to just let it
be specified per port?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux