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, Thomas.

On Wed, Apr 27, 2016 at 02:22:50PM +0200, Thomas Petazzoni wrote:
> I see a few possibilities:
> 
>  1/ Adjust all the drivers allocating manually an ahci_host_priv
>     structure, and make sure they initialize the fields to their default
>     values.
> 
>  2/ Add a new helper function that allows to allocate the
>     ahci_host_priv structure and initialize it with sane default values,
>     and use this helper in all drivers.
> 
>  3/ Add a flag in ahci_host_priv that tells whether non-standard port
>     offset/length are to be used. This is the most minimal solution,
>     but also maybe not the nicest one.

1 or 2 seems better to me.

> > If this needs to be configurable, wouldn't it be better to just let it
> > be specified per port?
> 
> How could it be per-port? The base for a port is calculated as:
> 
> 	base + <port_offset> + (port_no * <port_length>)
> 
> So, port_offset is clearly not per-port, there's only one of them. And
> if we were to make <port_length> a per-port property, then the formula
> would become a lot more complicated: we would have to iterate over each
> port, and see what is the length of the register area for each of them,
> to calculate the base address of the registers for the n-th port. This
> is clearly a complexity that is not needed for my use case: all ports
> have the same register area length, it's just that this length is
> non-standard.

Can't we just have hpriv->port_base?

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