summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Doan <andy.doan@linaro.org>2017-05-18 14:29:13 -0500
committerAndy Doan <andy.doan@linaro.org>2017-05-18 14:30:03 -0500
commit90d29193ea47b4aaa5dc9a612e8b48b396291e6e (patch)
tree4ab8a67577c7cc6c65881a03e352c552963d9fe9
parent5664eed5afd039b305e329fa29b38e89bcfde958 (diff)
linaro-metrics: don't count "applied" patches
We are counting patches like this: https://patches.linaro.org/patch/99942/ that should be ignored Change-Id: I20c916309c3a36336d9fb3922af28d5809fc7156
-rw-r--r--linaro_metrics/parsemail.py5
-rw-r--r--tests/data/applied-patch.mbox140
-rw-r--r--tests/test_import_emails.py13
3 files changed, 158 insertions, 0 deletions
diff --git a/linaro_metrics/parsemail.py b/linaro_metrics/parsemail.py
index d9743ed..5c5cd43 100644
--- a/linaro_metrics/parsemail.py
+++ b/linaro_metrics/parsemail.py
@@ -125,6 +125,11 @@ def linaro_parse_mail(crowd, real_parse_mail, mail):
emails
'''
+ if mail.get('Subject').startswith('Applied "'):
+ # a maintainer has applied a patch to their tree for the user. eg:
+ # https://patches.linaro.org/patch/99942/
+ return 0
+
if subject_check(mail.get('Subject')):
# this is a comment to a patch
return real_parse_mail(mail)
diff --git a/tests/data/applied-patch.mbox b/tests/data/applied-patch.mbox
new file mode 100644
index 0000000..6d800fe
--- /dev/null
+++ b/tests/data/applied-patch.mbox
@@ -0,0 +1,140 @@
+From patchwork Wed May 17 09:53:44 2017
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: Applied "regulator: Allow for asymmetric settling times" to the
+ regulator tree
+X-Patchwork-Submitter: Mark Brown <broonie@kernel.org>
+X-Patchwork-Id: 99942
+Message-Id: <E1dAveK-00078v-Fr@debutante>
+To: Matthias Kaehlcke <mka@chromium.org>
+Cc: Laxman Dewangan <ldewangan@nvidia.com>, Mark Brown <broonie@kernel.org>,
+ Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>,
+ Laxman Dewangan <ldewangan@nvidia.com>, Rob Herring <robh+dt@kernel.org>,
+ Mark Rutland <mark.rutland@arm.com>,
+ linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
+ Douglas Anderson <dianders@chromium.org>,
+ Brian Norris <briannorris@chromium.org>, linux-kernel@vger.kernel.org
+Date: Wed, 17 May 2017 10:53:44 +0100
+From: Mark Brown <broonie@kernel.org>
+List-Id: <linux-kernel.vger.kernel.org>
+
+The patch
+
+ regulator: Allow for asymmetric settling times
+
+has been applied to the regulator tree at
+
+ git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
+
+All being well this means that it will be integrated into the linux-next
+tree (usually sometime in the next 24 hours) and sent to Linus during
+the next merge window (or sooner if it is a bug fix), however if
+problems are discovered then the patch may be dropped or reverted.
+
+You may get further e-mails resulting from automated or manual testing
+and review of the tree, please engage with people reporting problems and
+send followup patches addressing any issues that are reported if needed.
+
+If any updates are required or you are submitting further changes they
+should be sent as incremental updates against current git, existing
+patches will not be replaced.
+
+Please add any relevant lists and maintainers to the CCs when replying
+to this mail.
+
+Thanks,
+Mark
+
+>From 3ffad468cf1d9825b425733941bdad0d8d20e795 Mon Sep 17 00:00:00 2001
+From: Matthias Kaehlcke <mka@chromium.org>
+Date: Tue, 16 May 2017 11:43:43 -0700
+Subject: [PATCH] regulator: Allow for asymmetric settling times
+
+Some regulators have different settling times for voltage increases and
+decreases. To avoid a time penalty on the faster transition allow for
+different settings for up- and downward transitions.
+
+Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
+Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
+Signed-off-by: Mark Brown <broonie@kernel.org>
+---
+ drivers/regulator/core.c | 6 ++++++
+ drivers/regulator/of_regulator.c | 19 +++++++++++++++++++
+ include/linux/regulator/machine.h | 6 ++++++
+ 3 files changed, 31 insertions(+)
+
+--
+2.11.0
+
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
+index c0d9ae8d0860..919b7f178209 100644
+--- a/drivers/regulator/core.c
++++ b/drivers/regulator/core.c
+@@ -2767,6 +2767,12 @@ static int _regulator_set_voltage_time(struct regulator_dev *rdev,
+ ramp_delay = rdev->desc->ramp_delay;
+ else if (rdev->constraints->settling_time)
+ return rdev->constraints->settling_time;
++ else if (rdev->constraints->settling_time_up &&
++ (new_uV > old_uV))
++ return rdev->constraints->settling_time_up;
++ else if (rdev->constraints->settling_time_down &&
++ (new_uV < old_uV))
++ return rdev->constraints->settling_time_down;
+
+ if (ramp_delay == 0) {
+ rdev_dbg(rdev, "ramp_delay not set\n");
+diff --git a/drivers/regulator/of_regulator.c b/drivers/regulator/of_regulator.c
+index 09d677d5d3f0..96bf75458da5 100644
+--- a/drivers/regulator/of_regulator.c
++++ b/drivers/regulator/of_regulator.c
+@@ -90,6 +90,25 @@ static void of_get_regulation_constraints(struct device_node *np,
+ if (!ret)
+ constraints->settling_time = pval;
+
++ ret = of_property_read_u32(np, "regulator-settling-time-up-us", &pval);
++ if (!ret)
++ constraints->settling_time_up = pval;
++ if (constraints->settling_time_up && constraints->settling_time) {
++ pr_warn("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-up-us'\n",
++ np->name);
++ constraints->settling_time_up = 0;
++ }
++
++ ret = of_property_read_u32(np, "regulator-settling-time-down-us",
++ &pval);
++ if (!ret)
++ constraints->settling_time_down = pval;
++ if (constraints->settling_time_down && constraints->settling_time) {
++ pr_warn("%s: ambiguous configuration for settling time, ignoring 'regulator-settling-time-down-us'\n",
++ np->name);
++ constraints->settling_time_down = 0;
++ }
++
+ ret = of_property_read_u32(np, "regulator-enable-ramp-delay", &pval);
+ if (!ret)
+ constraints->enable_time = pval;
+diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
+index 117699d1f7df..9cd4fef37203 100644
+--- a/include/linux/regulator/machine.h
++++ b/include/linux/regulator/machine.h
+@@ -110,6 +110,10 @@ struct regulator_state {
+ * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
+ * @settling_time: Time to settle down after voltage change when voltage
+ * change is non-linear (unit: microseconds).
++ * @settling_time_up: Time to settle down after voltage increase when voltage
++ * change is non-linear (unit: microseconds).
++ * @settling_time_down : Time to settle down after voltage decrease when
++ * voltage change is non-linear (unit: microseconds).
+ * @active_discharge: Enable/disable active discharge. The enum
+ * regulator_active_discharge values are used for
+ * initialisation.
+@@ -152,6 +156,8 @@ struct regulation_constraints {
+
+ unsigned int ramp_delay;
+ unsigned int settling_time;
++ unsigned int settling_time_up;
++ unsigned int settling_time_down;
+ unsigned int enable_time;
+
+ unsigned int active_discharge;
diff --git a/tests/test_import_emails.py b/tests/test_import_emails.py
index 003c09e..f576818 100644
--- a/tests/test_import_emails.py
+++ b/tests/test_import_emails.py
@@ -124,6 +124,19 @@ class TestImportEmail(TestCase):
Project.objects.all().delete()
crowd().get_user_no_cache.return_value = {'display-name': 'User Name'}
with import_emails.get_monkey_patcher()(import_emails.parser):
+ self._import_patch('applied-patch.mbox')
+ self.assertEqual(0, Patch.objects.all().count())
+ tcs = TeamCredit.objects.all()
+ self.assertEqual(0, tcs.count())
+
+ @mock.patch('linaro_metrics.parsemail.Crowd')
+ def test_monkey_patch_maintainer_applied(self, crowd):
+ '''Don't give a patch credit to a maintainer applying a patch to a
+ tree'''
+
+ Project.objects.all().delete()
+ crowd().get_user_no_cache.return_value = {'display-name': 'User Name'}
+ with import_emails.get_monkey_patcher()(import_emails.parser):
self._import_patch('author_not_linaro.mbox')
self.assertEqual(1, Patch.objects.all().count())
tcs = TeamCredit.objects.all()