dbus-sdr: Fix sensor missing issue.

There is issue for "BMC randomly unable to get sensor readings".
When invoking "ipmitool sdr" from Linux OS (host), it only
returns three sensors like following partial records:
[root@localhost ~]# ipmitool sdr
CPU Power        | 0 Watts           | ok
Memory Power     | 0 Watts           | ok
Total Power      | 0 Watts           | ok
[root@localhost ~]#

There 2 caches sensorTree and sensorDataRecords.
When sensorDataRecords cache and sensorTree cache is not sync,
which causes this issue, like sensorTree cache has 10 sensors
but there are just 5 sensors in sensorDataRecords cache.
Most important sensorDataRecords cache is not necessary,
ipmiStorageGetSDR could get data from dbus directly and
no any performance impact.

Using sensorMapUpdatePeriod(10s) but not sensorMapSdrUpdatePeriod(60s),
60 seconds are too long to answer user with some SDR content
at the first time of BMC bootup.

Tested:
All sensors could be listed even at booting phase.
Could print correct sensor set along with the boot progress.

root@intel-obmc:~# ipmitool sdr
CPU Power        | 202 Watts         | ok
Memory Power     | 0 Watts           | ok
Total Power      | 312 Watts         | ok
root@intel-obmc:~# ipmitool sdr
System Airflow   | 14 unspecified    | ok
PSU1 In Current  | 1.18 Amps         | ok
PSU1 Out Current | 20.80 Amps        | ok
PSU2 In Current  | 0 Amps            | ok
PSU2 Out Current | no reading        | ns
Pwm 1            | 29.79 unspecifi   | ok
Pwm 2            | 29.79 unspecifi   | ok
Pwm 3            | 29.79 unspecifi   | ok
Pwm 4            | 29.79 unspecifi   | ok
Pwm 5            | 29.79 unspecifi   | ok
Pwm 6            | 29.79 unspecifi   | ok
Pwm 13           | 29.79 unspecifi   | ok
Pwm 14           | 29.79 unspecifi   | ok
Pwm 15           | 29.79 unspecifi   | ok
Pwm 16           | 29.79 unspecifi   | ok
Pwm PSU1 Fan 1   | 39.98 unspecifi   | ok
Pwm PSU1 Fan 2   | 39.98 unspecifi   | ok
.............
PVCCD HV CPU1    | 1.18 Volts        | ok
PVCCFA EHV FIVRA | 1.16 Volts        | ok
PVCCINFAON CPU1  | 1.11 Volts        | ok
PVCCIN CPU1      | 1.68 Volts        | ok
PVNN PCH AUX     | 1.03 Volts        | ok
root@intel-obmc:~#

Ported from:
https://gerrit.openbmc-project.xyz/c/openbmc/intel-ipmi-oem/+/40362

Changes made:
 - Removed intel specific changes like nmDiscoveryIndex or
   ipmi::storage::nmDiscoverySDRCount

Change-Id: I729d9bcbf91f0e96c62fb5f5ebe0240a0eaa47df
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
Signed-off-by: Helen Huang <he.huang@linux.intel.com>
Signed-off-by: Kuiying Wang <kuiying.wang@intel.com>
Signed-off-by: Willy Tu <wltu@google.com>
4 files changed