Thread (15 messages) 15 messages, 4 authors, 2016-03-02

RE: [RFC PATCH] drivers: ata: Read Rx water mark value from device-tree

From: Anurag Kumar Vulisha <hidden>
Date: 2016-03-02 06:09:13
Also in: linux-ide, lkml

+ Michal
-----Original Message-----
From: Anurag Kumar Vulisha
Sent: Friday, February 26, 2016 7:18 PM
To: 'Rob Herring'
Cc: Arnd Bergmann; pawel.moll@arm.com; mark.rutland@arm.com;
ijc+devicetree@hellion.org.uk; galak@codeaurora.org; tj@kernel.org;
devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah Choudary
Kalluri
Subject: RE: [RFC PATCH] drivers: ata: Read Rx water mark value from device-
tree

Hi Rob,
quoted
-----Original Message-----
From: Rob Herring [mailto:robh@kernel.org]
Sent: Wednesday, February 24, 2016 1:00 AM
To: Anurag Kumar Vulisha
Cc: Arnd Bergmann; pawel.moll@arm.com; mark.rutland@arm.com;
ijc+devicetree@hellion.org.uk; galak@codeaurora.org; tj@kernel.org;
devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah
Choudary Kalluri
Subject: Re: [RFC PATCH] drivers: ata: Read Rx water mark value from
device- tree

On Tue, Feb 23, 2016 at 03:29:55PM +0000, Anurag Kumar Vulisha wrote:
quoted
Hi Arnd,
quoted
-----Original Message-----
From: Arnd Bergmann [mailto:arnd@arndb.de]
Sent: Tuesday, February 23, 2016 3:51 PM
To: Anurag Kumar Vulisha
Cc: robh+dt@kernel.org; pawel.moll@arm.com;
mark.rutland@arm.com;
quoted
quoted
quoted
ijc+devicetree@hellion.org.uk; galak@codeaurora.org;
ijc+tj@kernel.org;
devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
ide@vger.kernel.org; Anirudha Sarangi; Srikanth Vemula; Punnaiah
Choudary Kalluri
Subject: Re: [RFC PATCH] drivers: ata: Read Rx water mark value
from
device- tree

On Tuesday 23 February 2016 05:58:32 Anurag Kumar Vulisha wrote:
quoted
quoted
I don't know what is appropriate because I have no idea what
Rxwatermark is good for. Can you try describing why we can't
just set it to the correct value for everyone automatically?
This RX watermark level sets the minimum number of free
locations within the RX FIFO .When the rx fifo level crosses the
programmed watermark level ,sata controller  will transmit HOLDS
to the device asking it
to wait. This happens when dma reads the rx fifo data slower than
the device is sending the data. Note that it can take some time
for the HOLDs to get to the other end and in the time there must
be enough room in the FIFO to absorb all data that could arrive
from the
device.
quoted
quoted
quoted
Currently we are using 0x40 for this value, which works fine
with all hardware designs  we are currently having. But hoping
that this value may vary for future silicon versions, I wanted
to make this as a configurable
value. So for this reason I thought of moving it either to
device-tree or making it as a module_param() property.
quoted
Ok, so if this depends on the silicon version, your initial
approach would be better than the module_param.

I would probably make this dependent on the compatible string
instead, and have a table in the device driver that uses a
specific value for each variant of the device, but either way should be
fine.
quoted
quoted
quoted
Having a separate property is most appropriate if for each
hardware revision there is exactly one ideal value, while a table
in the driver makes more sense if this takes a bit of tuning and
the driver might choose to optimize it differently based on other
constraints, such as its own interrupt handler implementation.
Since we are  currently having one value in common for all the
hardware and also changing the rx water mark does not require any
changes other than vendor specific PTC register update , I think it
would be better  to  use device tree property for that rx watermark
value.
quoted
Doing this makes the updating of rx watermark value easy, if any
changes required.
quoted
In future, if any silicon version rx water mark value doesn't work
with the current versions, then  I will do as you said by
maintaining the table in device driver. But at present  I feel that
single rx watermark property in device tree would be enough, since
it works with all
the hardware versions we have.

If you currently have no reason to modify it now, then add it later
when you actually have a use case.
This property may vary from board to board . It also depends on the phy
reference clock frequency which can be changed based on use case. So
moving this property to device tree will make it easy for the  user  to
configure  this property based on the requirement.

Thanks,
Anuarg Kumar V

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help