iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Gary R Hook <gary.hook-5C7GfCeVMHo@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	Linux Kernel Mailing List
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry
Date: Tue, 13 Mar 2018 19:20:42 +0200	[thread overview]
Message-ID: <CAHp75Vfc+JTjU2P0GCedVFcHYniXoVcmRC3n4cFsLMr9sx6eyA@mail.gmail.com> (raw)
In-Reply-To: <152055669123.63229.1692099069085978884.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>

On Fri, Mar 9, 2018 at 2:51 AM, Gary R Hook <gary.hook-5C7GfCeVMHo@public.gmane.org> wrote:
> Initially (at boot) the device table values dumped are all of the
> active devices.  Add a devid debugfs file to allow the user to select a
> single device table entry to dump (active or not). Let any devid value
> greater than the maximum allowable PCI ID (0xFFFF) restore the
> behavior to that effective at boot.

> +               oboff += OSCNPRINTF("%02x:%02x:%x (%u / %04x)\n",
> +                                   PCI_BUS_NUM(amd_iommu_devid),
> +                                   PCI_SLOT(amd_iommu_devid),
> +                                   PCI_FUNC(amd_iommu_devid),

Perhaps at some point we will have an extension to %p to print PCI BDFs.

> +       if (strnchr(obuf, OBUFLEN, ':'))
> +       {

Style

> +       } else if (obuf[0] == '0' && obuf[1] == 'x') {
> +               n = sscanf(obuf, "%x", &amd_iommu_devid);
> +       } else {
> +               n = sscanf(obuf, "%d", &amd_iommu_devid);
> +       }

kstrtoint() ?

-- 
With Best Regards,
Andy Shevchenko

  parent reply	other threads:[~2018-03-13 17:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  0:50 [PATCH v2 0/5] Add debugfs info for the AMD IOMMU Gary R Hook
     [not found] ` <152055660594.63229.5131049527614494130.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-03-09  0:50   ` [PATCH v2 1/5] iommu/amd - Add debugfs support Gary R Hook
     [not found]     ` <152055664720.63229.16209149030018336339.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-03-13 17:16       ` Andy Shevchenko
     [not found]         ` <CAHp75VdK6qFopBE4rD4yNO5GHccxyte=GhYU7YGcWOEYSCyX8Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-13 18:54           ` Gary R Hook
     [not found]             ` <30bd9559-0e44-bd18-6b9a-ec35bc8276f3-5C7GfCeVMHo@public.gmane.org>
2018-03-13 20:23               ` Andy Shevchenko
     [not found]                 ` <CAHp75VeySPBEeJKRXzmqfPey56J3rwr2-dPRzSYx+7a7TAC5rw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-14 15:24                   ` Gary R Hook
     [not found]                     ` <08d19301-7e8e-7586-8ffb-91823af0d31b-5C7GfCeVMHo@public.gmane.org>
2018-03-14 15:29                       ` Andy Shevchenko
     [not found]                         ` <CAHp75VeEUCVSKLH0aobk=+GjVHWgO_OAKZRCx8gqDc9tWvESMw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-14 22:23                           ` Gary R Hook
2018-03-09  0:50   ` [PATCH v2 2/5] iommu/amd - Add a 'verbose' switch for IOMMU debugfs Gary R Hook
2018-03-09  0:51   ` [PATCH v2 3/5] iommu/amd - Add a README variable for the " Gary R Hook
2018-03-09  0:51   ` [PATCH v2 4/5] iommu/amd - Expose the active IOMMU device table entries Gary R Hook
2018-03-09  0:51   ` [PATCH v2 5/5] iommu/amd - Add a debugfs entry to specify a IOMMU device table entry Gary R Hook
     [not found]     ` <152055669123.63229.1692099069085978884.stgit-tq90VzyE+wXkLsZ8J5Uweg@public.gmane.org>
2018-03-13 17:20       ` Andy Shevchenko [this message]
     [not found]         ` <CAHp75Vfc+JTjU2P0GCedVFcHYniXoVcmRC3n4cFsLMr9sx6eyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-13 18:54           ` Gary R Hook
     [not found]             ` <3969f155-c3bf-44c5-d056-825e71d42152-5C7GfCeVMHo@public.gmane.org>
2018-03-13 20:56               ` Andy Shevchenko
     [not found]                 ` <CAHp75VcuYamhrEu=B1zeFpz6s1vGfZaMyonYK6p_Y_EJF4=4Ng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-03-14 15:24                   ` Gary R Hook

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=CAHp75Vfc+JTjU2P0GCedVFcHYniXoVcmRC3n4cFsLMr9sx6eyA@mail.gmail.com \
    --to=andy.shevchenko-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=gary.hook-5C7GfCeVMHo@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 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).