All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Jan Glauber <jglauber@cavium.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Steven J . Hill" <Steven.Hill@cavium.com>,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH v12 4/9] mmc: cavium: Work-around hardware bug on cn6xxx and cnf7xxx
Date: Tue, 21 Mar 2017 13:22:05 -0700	[thread overview]
Message-ID: <79a1e294-797d-8b1f-0dcd-129df268c089@caviumnetworks.com> (raw)
In-Reply-To: <CAK8P3a3PBx14CpGY5g7U9YHk3zkvVV=7gJHuSh50eOVKcfVAqA@mail.gmail.com>

On 03/21/2017 12:49 PM, Arnd Bergmann wrote:
> On Tue, Mar 21, 2017 at 4:19 PM, David Daney <ddaney@caviumnetworks.com> wrote:
>> On 03/21/2017 01:58 AM, Arnd Bergmann wrote:
>>>
>>> On Mon, Mar 20, 2017 at 9:45 PM, David Daney <ddaney@caviumnetworks.com>
>>> wrote:
>>>>
>>>> On 03/17/2017 07:13 AM, Ulf Hansson wrote:
>>>>>
>>>>> My point is really that we should avoid exporting SoC specific APIs
>>>>> which shall be called from drivers. This is old fashion.
>>>>
>>>>
>>>>
>>>> Some people find it objectionable to see 1-off architecture specific
>>>> in-line
>>>> asm in a driver file, but I agree that putting it as close to the user as
>>>> possible makes sense.
>>>
>>>
>>> The proper solution might be to create an architecture independent
>>> interface
>>> for it, what it is that the function does. Can you explain what the
>>> purpose
>>> of locking/unlocking the cache line for MMC is? Is this something that
>>> could be done more generally in the dma_map_ops implementation?
>>
>>
>> It is a 1-off erratum workaround that is only needed on fewer than five
>> models/revisions of a mips64 based SoC family.  As such, creating a general
>> purpose, architecture independent, framework is clearly not the proper
>> approach.
>
> If this is just for maintaining coherency of the DMA operation inbetween,
> then there is already a generic API for that, which the driver calls.
> Adding the workaround into octeon_dma_map_sg() would be a way
> to abstract the platform erratum from the driver.
>

Either I am bad at explaining things, or you are not reading what I wrote.

These are two facts about the bug:

1) The bug has nothing to do with coherency management, so hacking 
something into dma_map* is the wrong thing to do.

2) The bug effects exactly one device, so hacking something into common 
code that is used by other devices is the wrong thing to do.

Suggesting that we use an alternate set of facts, although an 
interesting exercise, doesn't get us closer to answering the question of 
which source code file should contain the code.

This is one opinion about the bug:

1) The bug is in the device, not the "platform", so putting the 
workaround code in the driver for the device may be the cleanest approach.

David Daney

  reply	other threads:[~2017-03-21 20:22 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10 13:24 [PATCH v12 0/9] Cavium MMC driver Jan Glauber
2017-03-10 13:24 ` [PATCH v12 1/9] dt-bindings: mmc: Add Cavium SOCs MMC bindings Jan Glauber
2017-03-17  8:31   ` Ulf Hansson
2017-03-17 10:51     ` Jan Glauber
2017-03-17 10:51       ` Jan Glauber
2017-03-10 13:25 ` [PATCH v12 2/9] mmc: cavium: Add core MMC driver for Cavium SOCs Jan Glauber
2017-03-17 11:24   ` Ulf Hansson
2017-03-17 13:34     ` Jan Glauber
2017-03-17 13:47       ` Ulf Hansson
2017-03-10 13:25 ` [PATCH v12 3/9] mmc: cavium: Add MMC platform driver for Octeon SOCs Jan Glauber
2017-03-17 13:35   ` Ulf Hansson
2017-03-20 14:40     ` Jan Glauber
2017-03-20 15:19       ` Ulf Hansson
2017-03-10 13:25 ` [PATCH v12 4/9] mmc: cavium: Work-around hardware bug on cn6xxx and cnf7xxx Jan Glauber
2017-03-17 14:13   ` Ulf Hansson
2017-03-20 20:34     ` Arnd Bergmann
2017-03-20 20:45     ` David Daney
2017-03-21  8:58       ` Arnd Bergmann
2017-03-21 15:19         ` David Daney
2017-03-21 19:49           ` Arnd Bergmann
2017-03-21 20:22             ` David Daney [this message]
2017-03-22 10:00               ` Jan Glauber
2017-03-10 13:25 ` [PATCH v12 5/9] mmc: cavium: Add support for Octeon cn7890 Jan Glauber
2017-03-10 13:25 ` [PATCH v12 6/9] mmc: cavium: Add MMC PCI driver for ThunderX SOCs Jan Glauber
2017-03-17 14:58   ` Ulf Hansson
2017-03-23  8:58     ` Jan Glauber
2017-03-23  9:28       ` Ulf Hansson
2017-03-23 17:41         ` David Daney
2017-03-10 13:25 ` [PATCH v12 7/9] mmc: cavium: Add scatter-gather DMA support Jan Glauber
2017-03-10 13:25 ` [PATCH v12 8/9] mmc: cavium: Support DDR mode for eMMC devices Jan Glauber
2017-03-10 13:25 ` [PATCH v12 9/9] MAINTAINERS: Add entry for Cavium MMC driver Jan Glauber
2017-03-15 15:57 ` [PATCH v12 0/9] " Arnd Bergmann
2017-03-15 16:20   ` Jan Glauber

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=79a1e294-797d-8b1f-0dcd-129df268c089@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=Steven.Hill@cavium.com \
    --cc=arnd@arndb.de \
    --cc=david.daney@cavium.com \
    --cc=jglauber@cavium.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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 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.