linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Bob Cochran <ppc@mindchasers.com>
Cc: <madalin.bucur@freescale.com>, <linuxppc-dev@lists.ozlabs.org>,
	"Igal Liberman" <Igal.Liberman@freescale.com>
Subject: Re: [PATCH 08/12] fsl/fman: Add Frame Manager support
Date: Mon, 15 Jun 2015 23:33:10 -0500	[thread overview]
Message-ID: <1434429190.2353.35.camel@freescale.com> (raw)
In-Reply-To: <557F9B3A.2000108@mindchasers.com>

On Mon, 2015-06-15 at 23:42 -0400, Bob Cochran wrote:
> On 06/10/2015 11:21 AM, Madalin Bucur wrote:
> > 
> > +#define FM_QMI_NO_ECC_EXCEPTIONS           /* P1 */
> > +#define FM_CSI_CFED_LIMIT                  /* P1 */
> > +#define FM_PEDANTIC_DMA                            /* P1 */
> > +#define FM_QMI_NO_DEQ_OPTIONS_SUPPORT              /* P1 */
> > +#define FM_HAS_TOTAL_DMAS                  /* P1-P5 */
> > +#define FM_DEQ_PIPELINE_PARAMS_FOR_OP              /* P1, T/B */
> > +#define FM_NO_DISPATCH_RAM_ECC                     /* P2-P5 */
> > +#define FM_NO_WATCHDOG                             /* P4 */
> > +#define FM_NO_TNUM_AGING                   /* P2-P5 */
> > +#define FM_NO_BACKUP_POOLS                 /* P2-P5 */
> > +#define FM_NO_OP_OBSERVED_POOLS            /* P2-P5, T/B */
> > +#define FM_NO_ADVANCED_RATE_LIMITER                /* P2-P5 */
> > +#define FM_OP_OPEN_DMA_MIN_LIMIT           /* T/B */
> > +#define FM_NO_RESTRICT_ON_ACCESS_RSRC              /* T/B */
> > +#define FM_FRAME_END_PARAMS_FOR_OP         /* T/B */
> > +#define FM_QMI_NO_SINGLE_ECC_EXCEPTION             /* T/B */
> > +
> > +/* FMan Errata */
> 
> 
> Will there be documentation to let the user know how to turn off and 
> on these errata (code fixes) ?  From reviewing the source for some 
> of the errata fixes, I gather it's not always automatic.  I saw that 
> booleans are sometimes used (e.g, bcb_workaround) along with HW 
> block IP version information to either apply the errata or not.

The above defines need to go.  The driver should support any supported 
chip without compile-time knowledge.  If they're meant to give the 
*option* to optimize away things on chips that don't have certain 
requirements, that should be limited to codepaths where testing shows 
it makes a significant difference, and the choice of supported chips 
(not a list of fman internal knobs) needs to be exposed to kconfig.

> Also, some of the comments and errata names below refer to 
> information that is probably strictly internal to Freescale, so how 
> can I be sure whether to apply these errata or not and their 
> purpose?   My concern is that some of these errata may be applied to 
> my SoC by default when they shouldn't be, and I may not know if it's 
> a potential problem.  I saw this sort of thing in the SDK kernel 
> when FMAN V3H errata fixes were applied to FMAN V3L and wrong values 
> were set due to V3L having lesser capabilities than V3H.

Yes, the SDK kernel has problems with multiplatform support in the 
FMan driver.  We don't want to repeat those problems here.

> +
> > +static inline bool TRY_LOCK(spinlock_t *spinlock, volatile bool 
> > *p_flag)
> > +{
> > +   unsigned long int_flags;
> > +
> > +   if (spinlock)
> > +           spin_lock_irqsave(spinlock, int_flags);
> > +   else
> > +           local_irq_save(int_flags);
> > +
> > +   if (*p_flag) {
> > +           if (spinlock)
> > +                   spin_unlock_irqrestore(spinlock, int_flags);
> > +           else
> > +                   local_irq_restore(int_flags);
> > +           return false;
> > +   }
> > +   *p_flag = true;
> > +
> > +   if (spinlock)
> > +           spin_unlock_irqrestore(spinlock, int_flags);
> > +   else
> > +           local_irq_restore(int_flags);
> > +
> > +   return true;
> > +}
> > +
> > +#define RELEASE_LOCK(_flag) (_flag = false)

Even aside from the question of why this wrapper is needed to begin 
with, this is not a correct implementation of lock release.  There's 
nothing stopping either compiler or hardware reordering of the store 
to _flag relative to any accesses to lock-protected data.

-Scott

  reply	other threads:[~2015-06-16  4:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10 15:21 [PATCH 00/12] Freescale DPAA FMan Madalin Bucur
2015-06-10 15:21 ` [PATCH 07/12] fsl/fman: Add FMan MURAM support Madalin Bucur
2015-06-10 15:21   ` [PATCH 01/12] fsl/fman: Add the FMan FLIB headers Madalin Bucur
2015-06-10 15:21     ` [PATCH 08/12] fsl/fman: Add Frame Manager support Madalin Bucur
2015-06-10 15:21       ` [PATCH 02/12] fsl/fman: Add the FMan FLIB Madalin Bucur
2015-06-10 15:21         ` [PATCH 09/12] fsl/fman: Add FMan MAC support Madalin Bucur
2015-06-10 15:21           ` [PATCH 03/12] fsl/fman: Add the FMan port FLIB headers Madalin Bucur
2015-06-10 15:21             ` [PATCH 10/12] fsl/fman: Add FMan SP support Madalin Bucur
2015-06-10 15:21               ` [PATCH 04/12] fsl/fman: Add the FMan port FLIB Madalin Bucur
2015-06-10 15:21                 ` [PATCH 11/12] fsl/fman: Add FMan Port Support Madalin Bucur
2015-06-10 15:21                   ` [PATCH 05/12] fsl/fman: Add the FMan MAC FLIB headers Madalin Bucur
2015-06-10 15:21                     ` [PATCH 12/12] fsl/fman: Add FMan MAC driver Madalin Bucur
2015-06-10 15:21                       ` [PATCH 06/12] fsl/fman: Add the FMan MAC FLIB Madalin Bucur
2015-06-11  8:55       ` [PATCH 08/12] fsl/fman: Add Frame Manager support Paul Bolle
2015-06-11  9:37         ` Paul Bolle
2015-06-15 14:23           ` Liberman Igal
2015-06-16  3:42       ` Bob Cochran
2015-06-16  4:33         ` Scott Wood [this message]
2015-06-10 18:54     ` [PATCH 01/12] fsl/fman: Add the FMan FLIB headers Scott Wood
2015-06-17 14:59       ` Liberman Igal
2015-06-17 17:57         ` Scott Wood
2015-06-10 18:52 ` [PATCH 00/12] Freescale DPAA FMan Scott Wood
  -- strict thread matches above, loose matches on Subject: below --
2015-06-10  8:03 [PATCH 08/12] fsl/fman: Add Frame Manager support Igal.Liberman

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=1434429190.2353.35.camel@freescale.com \
    --to=scottwood@freescale.com \
    --cc=Igal.Liberman@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madalin.bucur@freescale.com \
    --cc=ppc@mindchasers.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).