From: Peter Zijlstra <peterz@infradead.org>
To: steven.kinney@amd.com
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
iommu@lists.linux-foundation.org, joro@8bytes.org,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Subject: Re: [PATCH 1/2] IOMMU/AMD: Adding IOMMU PC resource management
Date: Tue, 14 May 2013 09:09:24 +0200 [thread overview]
Message-ID: <20130514070924.GA15942@dyad.programming.kicks-ass.net> (raw)
In-Reply-To: <1368481424-5626-1-git-send-email-steven.kinney@amd.com>
On Mon, May 13, 2013 at 04:43:44PM -0500, steven.kinney@amd.com wrote:
> +static void init_iommu_perf_ctr(struct amd_iommu *iommu)
> +{
> + u32 val = 0xabcd, val2 = 0;
> +
> + if (!iommu_feature(iommu, FEATURE_PC))
> + return;
> +
> + amd_iommu_pc_present = true;
> +
> + /* Check if the performance counters can be written to */
> + if ((0 != amd_iommu_pc_get_set_reg_val(0, 0, 0, 0, &val, true)) ||
> + (0 != amd_iommu_pc_get_set_reg_val(0, 0, 0, 0, &val2, false)) ||
> + (val != val2)) {
> + pr_err("AMD-Vi: Unable to write to IOMMU perf counter.\n");
Would it make sense to clear amd_iommu_pc_present here?
> + return;
> + }
> +
> + pr_info("AMD-Vi: IOMMU performance counters " "supported\n");
> +
> + val = readl(iommu->mmio_base + MMIO_CNTR_CONF_OFFSET);
> + iommu->max_banks = (u8) ((val >> 12) & 0x3f);
> + iommu->max_counters = (u8) ((val >> 7) & 0xf);
> +}
next prev parent reply other threads:[~2013-05-14 7:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-13 21:43 steven.kinney
2013-05-14 7:09 ` Peter Zijlstra [this message]
2013-05-14 14:37 ` Suravee Suthikulanit
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=20130514070924.GA15942@dyad.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=steven.kinney@amd.com \
--cc=suravee.suthikulpanit@amd.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
Powered by JetHome