Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
From: Logan Gunthorpe <lsgunthorpe@gmail.com>
To: Serge Semin <fancer.lancer@gmail.com>
Cc: linux-ntb <linux-ntb@googlegroups.com>
Subject: Re: [PATCH v4] NTB: Add IDT 89HPESxNTx PCIe-switches support
Date: Mon, 6 Mar 2017 20:27:49 -0700	[thread overview]
Message-ID: <26e320d1-392c-ee60-440c-e293d7dc86bc@gmail.com> (raw)
In-Reply-To: <20170307015755.GA14511@mobilestation.tp-local.ru>



On 06/03/17 06:57 PM, Serge Semin wrote:
> Agreed. Replaced with traditional dev_*() methods.

You should also be printing using the ntb's device and not the parent
device. ie use:

ndev->ntb.dev

instead of

ndev->ntb.pdev->dev


> It's obvious, to prevent a race condition of access to the Mapping table, which
> is implemented by Address and Data registers set.
> For the same reason the driver have spin lock to protect an access to the
> Global Switch registers using GASA-ADDR and GASA-DATA.

Ah, I see. Perhaps these should be in their own function in the same way
as the gasa functions? It would probably be a bit clearer.

> Kind of funny. You've sent some comments about devres methods usage, but
> suspected a memory leak at the moment where it's actually used. So take a look
> at the place of "ndev" structure allocation, and you'll find an answer.

Ah sorry, I missed that. Usually I expect to see the structure free'd by
the release function on the device. But NTB is a little odd in that regard.

Also, per section 8 of the Linux style guide[1], IMO this code is pretty
over commented.

Logan


[1] https://static.lwn.net/kerneldoc/process/coding-style.html#commenting

  reply	other threads:[~2017-03-07  3:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-01 21:37 [PATCH] NTB: Add IDT 89HPESxNTx PCIe-switches support Serge Semin
2017-02-02 18:10 ` Allen Hubbe
2017-02-20 21:33 ` [PATCH v2] " Serge Semin
2017-02-21 22:42   ` Allen Hubbe
2017-02-22 11:01     ` Serge Semin
2017-02-24 10:49   ` [PATCH v3] " Serge Semin
2017-02-24 16:01     ` Allen Hubbe
2017-02-27  9:22     ` [PATCH v4] " Serge Semin
2017-03-01 16:30       ` Jon Mason
2017-03-03  6:38       ` lsgunthorpe
2017-03-07  1:57         ` Serge Semin
2017-03-07  3:27           ` Logan Gunthorpe [this message]
2017-03-07 15:09             ` Serge Semin
2017-03-07 17:00               ` Logan Gunthorpe
2017-03-07  2:02       ` [PATCH v5] " Serge Semin
2017-03-08 18:01         ` Jon Mason
2017-03-08 20:29         ` [PATCH v6] " Serge Semin
2017-04-12 12:44           ` [PATCH v7] " Serge Semin

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=26e320d1-392c-ee60-440c-e293d7dc86bc@gmail.com \
    --to=lsgunthorpe@gmail.com \
    --cc=fancer.lancer@gmail.com \
    --cc=linux-ntb@googlegroups.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