summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-phosphor/host/phosphor-host-postd/0001-Avoid-negated-postcode-write-to-D-Bus.patch
blob: 37b57fd113c28b8b936aba885b1faae6e20f3730 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
From c931dfac478b3ac045a399ca372ddef847bcf9dd Mon Sep 17 00:00:00 2001
From: AppaRao Puli <apparao.puli@linux.intel.com>
Date: Mon, 21 Dec 2020 01:00:28 +0530
Subject: [PATCH] Avoid negated postcode write to D-Bus

This commit removes the code which writes the negated
postcode value to D-Bus object. This has some side effects
when bombarded data pushed to port 80.

With this change, if same post code is written on LPC channel
it will be set but D-Bus will not emit the 'PropertiesChanged'
signal. Actually there is no need to emit the signal if actual
property value(postcode) is not changed.

So if post code is changes, D-Bus will emit the signal as usual
with this code. Any client applications depends on this, still
can register for signal for knowing postcode change.

Tested:
 - Manually verified setting different post code emits the signal.

   busctl set-property xyz.openbmc_project.State.Boot.Raw
   /xyz/openbmc_project/state/boot/raw xyz.openbmc_project.State.Boot.Raw
   Value t 00

   dbus-monitor --system "type='signal',member='PropertiesChanged',
   interface='org.freedesktop.DBus.Properties',
   path_namespace=/xyz/openbmc_project/state/boot/raw,
   arg0=xyz.openbmc_project.State.Boot.Raw"

 - Verified functionality with real post code changes.

Signed-off-by: AppaRao Puli <apparao.puli@linux.intel.com>
---
 main.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/main.cpp b/main.cpp
index 1094e43..5d5d923 100644
--- a/main.cpp
+++ b/main.cpp
@@ -62,10 +62,6 @@ void PostCodeEventHandler(sdeventplus::source::IO& s, int postFd, uint32_t,
         {
             fprintf(stderr, "Code: 0x%" PRIx64 "\n", code);
         }
-        // HACK: Always send property changed signal even for the same code
-        // since we are single threaded, external users will never see the
-        // first value.
-        reporter->value(~code, true);
         reporter->value(code);
 
         // read depends on old data being cleared since it doens't always read
-- 
2.7.4