dbus-sensors: move the patch order

move 106 patch to the before all the other nvme patches.
remove the unneeded 048 patches.
rebase nvme patches due to reordering

Google-Bug-Id: 303793041
Signed-off-by: Tom Tung <tomtung@google.com>
Change-Id: Ibe360ae60fba52549773b697cb9be8ef6a985653
diff --git a/recipes-phosphor/sensors/dbus-sensors/0002-nvme-sensor-refactor-the-code.patch b/recipes-phosphor/sensors/dbus-sensors/0002-nvme-sensor-refactor-the-code.patch
index 09a9c80..b95cdf4 100644
--- a/recipes-phosphor/sensors/dbus-sensors/0002-nvme-sensor-refactor-the-code.patch
+++ b/recipes-phosphor/sensors/dbus-sensors/0002-nvme-sensor-refactor-the-code.patch
@@ -1,4 +1,4 @@
-From 3e6f30a5d5db64fa8009196a741249d6265bf3cc Mon Sep 17 00:00:00 2001
+From 5c11ea7c6ff02d456c9608a1eae372054a97c4e5 Mon Sep 17 00:00:00 2001
 From: Hao Jiang <jianghao@google.com>
 Date: Mon, 29 Aug 2022 17:21:06 +0000
 Subject: [PATCH 3/3] nvme sensor: refactor the code
@@ -128,8 +128,8 @@
  src/NVMeSensorMain.cpp | 219 ++++++++++++++++++----------------------
  src/NVMeSubsys.cpp     | 223 +++++++++++++++++++++++++++++++++++++++++
  src/NVMeSubsys.hpp     |  69 +++++++++++++
- src/meson.build        |   6 +-
- 9 files changed, 577 insertions(+), 358 deletions(-)
+ src/meson.build        |   5 +-
+ 9 files changed, 577 insertions(+), 357 deletions(-)
  create mode 100644 src/NVMeSubsys.cpp
  create mode 100644 src/NVMeSubsys.hpp
 
@@ -1358,10 +1358,10 @@
 +    };
 +};
 diff --git a/src/meson.build b/src/meson.build
-index 91cd60b..c142d87 100644
+index 99ac579..26267b3 100644
 --- a/src/meson.build
 +++ b/src/meson.build
-@@ -201,16 +201,16 @@ if get_option('nvme').enabled()
+@@ -194,15 +194,16 @@ if get_option('nvme').enabled()
      nvme_srcs = [
          'NVMeSensorMain.cpp',
          'NVMeSensor.cpp',
@@ -1376,11 +1376,10 @@
          'nvmesensor',
          sources: nvme_srcs,
          dependencies: nvme_deps,
--        cpp_args: uring_args,
-+        cpp_args: [uring_args, '-UBOOST_ASIO_NO_DEPRECATED'],
++        cpp_args: ['-UBOOST_ASIO_NO_DEPRECATED'],
          install: true,
      )
  endif
 -- 
-2.41.0.487.g6d72f3e995-goog
+2.42.0.609.gbb76f46606-goog
 
diff --git a/recipes-phosphor/sensors/dbus-sensors/0022-nvmesensor-segmentation-fault-workaround-and-fix.patch b/recipes-phosphor/sensors/dbus-sensors/0022-nvmesensor-segmentation-fault-workaround-and-fix.patch
index d687a68..9290d15 100644
--- a/recipes-phosphor/sensors/dbus-sensors/0022-nvmesensor-segmentation-fault-workaround-and-fix.patch
+++ b/recipes-phosphor/sensors/dbus-sensors/0022-nvmesensor-segmentation-fault-workaround-and-fix.patch
@@ -1,4 +1,4 @@
-From f3b61ab13f81f758519c9ebb4ac04023539708bb Mon Sep 17 00:00:00 2001
+From 8409b3df50a04fef02b542856ea2374691b8f4e4 Mon Sep 17 00:00:00 2001
 From: Jinliang Wang <jinliangw@google.com>
 Date: Fri, 20 Jan 2023 11:53:54 -0800
 Subject: [PATCH] nvmesensor: segmentation fault workaround and fix
@@ -87,18 +87,18 @@
                  });
                  return;
 diff --git a/src/meson.build b/src/meson.build
-index 22fabd9..20c6dd8 100644
+index a2f885a..c491d39 100644
 --- a/src/meson.build
 +++ b/src/meson.build
-@@ -235,7 +235,7 @@ if get_option('nvme').enabled()
+@@ -228,7 +228,7 @@ if get_option('nvme').enabled()
          'nvmesensor',
          sources: nvme_srcs,
          dependencies: nvme_deps,
--        cpp_args: [uring_args, '-UBOOST_ASIO_NO_DEPRECATED'],
-+        cpp_args: uring_args + ['-frtti', '-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
+-        cpp_args: ['-UBOOST_ASIO_NO_DEPRECATED'],
++        cpp_args: ['-frtti', '-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
          install: true,
      )
  endif
 -- 
-2.41.0.487.g6d72f3e995-goog
+2.42.0.609.gbb76f46606-goog
 
diff --git a/recipes-phosphor/sensors/dbus-sensors/0033-Enable-asio-threads-and-boost-coroutine.patch b/recipes-phosphor/sensors/dbus-sensors/0033-Enable-asio-threads-and-boost-coroutine.patch
index cf5533b..7f1e95f 100644
--- a/recipes-phosphor/sensors/dbus-sensors/0033-Enable-asio-threads-and-boost-coroutine.patch
+++ b/recipes-phosphor/sensors/dbus-sensors/0033-Enable-asio-threads-and-boost-coroutine.patch
@@ -1,4 +1,4 @@
-From 6639b4b4e59806b654d468e8e76776366afacf7c Mon Sep 17 00:00:00 2001
+From b1541f494e76f85741ad7fa1a10efbec73b7597a Mon Sep 17 00:00:00 2001
 From: Matt Johnston <matt@codeconstruct.com.au>
 Date: Wed, 18 Jan 2023 15:53:54 +0800
 Subject: [PATCH 33/44] Enable asio threads and boost coroutine
@@ -16,20 +16,20 @@
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/meson.build b/meson.build
-index fdbecfd..bdcbb93 100644
+index 8dfa828..b8cb10c 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -30,8 +30,8 @@ add_project_arguments(
+@@ -29,8 +29,8 @@ add_project_arguments(
      '-DBOOST_NO_RTTI',
      '-DBOOST_NO_TYPEID',
      '-DBOOST_ALL_NO_LIB',
 -    '-DBOOST_ASIO_DISABLE_THREADS',
      '-DBOOST_ALLOW_DEPRECATED_HEADERS',
 +    '-DBOOST_ASIO_HAS_THREADS',
-     language: 'cpp',
- )
- 
-@@ -66,7 +66,7 @@ systemd_system_unit_dir = systemd.get_variable(
+     '-DBOOST_ASIO_HAS_IO_URING',
+     '-DBOOST_ASIO_DISABLE_EPOLL',
+     '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT',
+@@ -68,7 +68,7 @@ systemd_system_unit_dir = systemd.get_variable(
      pkgconfig_define: ['prefix', get_option('prefix')])
  threads = dependency('threads')
  
@@ -39,5 +39,5 @@
    subproject('boost', required: false)
    boost_inc = include_directories('subprojects/boost_1_79_0/', is_system:true)
 -- 
-2.34.1
+2.42.0.609.gbb76f46606-goog
 
diff --git a/recipes-phosphor/sensors/dbus-sensors/0048-Add-uring_args-for-all-build-targets-in-package.patch b/recipes-phosphor/sensors/dbus-sensors/0048-Add-uring_args-for-all-build-targets-in-package.patch
deleted file mode 100644
index ef2c0c9..0000000
--- a/recipes-phosphor/sensors/dbus-sensors/0048-Add-uring_args-for-all-build-targets-in-package.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From 55fef4675991af139180fe9cca9dd2caaf6c38c6 Mon Sep 17 00:00:00 2001
-From: Zhikui Ren <zhikui.ren@intel.com>
-Date: Tue, 6 Jun 2023 12:14:19 -0700
-Subject: [PATCH] Add uring_args for all build targets in package
-
-io_uring backend is enabled with uring_args. Add them to package args.
-All build targets including static libraries for utils and thresholds
-and sensor services executables are built consistently.
-
-Currently steady timer in utils.cpp fires right away for services build
-with io_uring enabled like fansensor, hwmontempsensor.
-https://github.com/openbmc/dbus-sensors/blob/master/src/Utils.cpp#L472
-
-Tested:
-Added debug print and verified the above timer handler is called 10
-seconds after the timer is started as expected. intelcpusensor, which
-does not use random_access_file with io_uring backend reads sensor
-values successfully. Services use random_access_file read sensor data
-successfully.
-
-Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
-Change-Id: I8cf3a9a0d1ffca459eb6c2c37e4e2220ce5100ac
----
- meson.build       |  8 +++-----
- src/meson.build   | 13 +------------
- tests/meson.build |  2 +-
- 3 files changed, 5 insertions(+), 18 deletions(-)
-
-diff --git a/meson.build b/meson.build
-index 91ee75a..b822667 100644
---- a/meson.build
-+++ b/meson.build
-@@ -15,11 +15,6 @@ project(
- # with io_uring.  For the moment, we enable uring for all other daemons, but
- # we'd like to enable it for all daemons.
- # https://github.com/openbmc/dbus-sensors/issues/19
--uring_args = [
--    '-DBOOST_ASIO_HAS_IO_URING',
--    '-DBOOST_ASIO_DISABLE_EPOLL',
--    '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT',
--]
- 
- add_project_arguments(
-     '-Wno-psabi',
-@@ -32,6 +27,9 @@ add_project_arguments(
-     '-DBOOST_ALL_NO_LIB',
-     '-DBOOST_ALLOW_DEPRECATED_HEADERS',
-     '-DBOOST_ASIO_HAS_THREADS',
-+    '-DBOOST_ASIO_HAS_IO_URING',
-+    '-DBOOST_ASIO_DISABLE_EPOLL',
-+    '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT',
-     language: 'cpp',
- )
- 
-diff --git a/src/meson.build b/src/meson.build
-index 20c6dd8..c491d39 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -82,7 +82,6 @@ if get_option('adc').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -113,7 +112,6 @@ if get_option('exit-air').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -130,7 +128,6 @@ if get_option('fan').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -146,7 +143,6 @@ if get_option('hwmon-temp').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -162,7 +158,6 @@ if get_option('intrusion').enabled()
-             i2c,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -177,7 +172,6 @@ if get_option('ipmb').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -192,7 +186,6 @@ if get_option('mcu').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -235,7 +228,7 @@ if get_option('nvme').enabled()
-         'nvmesensor',
-         sources: nvme_srcs,
-         dependencies: nvme_deps,
--        cpp_args: uring_args + ['-frtti', '-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
-+        cpp_args: ['-frtti', '-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
-         install: true,
-     )
- endif
-@@ -253,7 +246,6 @@ if get_option('psu').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -268,7 +260,6 @@ if get_option('gpiosensor').enabled()
-             sdbusplus,
-             gpiodcxx,
-         ],
--        cpp_args: uring_args,
-         implicit_include_directories: false,
-         include_directories: '../include',
-         install: true
-@@ -285,7 +276,6 @@ if get_option('external').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-@@ -302,7 +292,6 @@ if get_option('redfish').enabled()
-             thresholds_dep,
-             utils_dep,
-         ],
--        cpp_args: uring_args,
-         install: true,
-     )
- endif
-diff --git a/tests/meson.build b/tests/meson.build
-index 4195434..e17a424 100644
---- a/tests/meson.build
-+++ b/tests/meson.build
-@@ -47,7 +47,7 @@ if run_command('/usr/bin/bash', '-c', 'busctl tree xyz.openbmc_project.ObjectMap
-             '../src/NVMeSensor.cpp',
-             '../src/NVMeSubsys.cpp',
-             '../src/NVMeController.cpp',
--            cpp_args: uring_args + ['-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
-+            cpp_args: ['-UBOOST_ASIO_NO_DEPRECATED', '-UBOOST_ASIO_DISABLE_THREADS', '-UBOOST_ASIO_HAS_IO_URING'],
-             dependencies: [ut_deps_list, nvme_deps],
-             implicit_include_directories: false,
-             include_directories: '../src',
--- 
-2.34.1
-
diff --git a/recipes-phosphor/sensors/dbus-sensors/0106-Add-uring_args-for-all-build-targets-in-package.patch b/recipes-phosphor/sensors/dbus-sensors/0106-Add-uring_args-for-all-build-targets-in-package.patch
index d1d1ac3..bcce55e 100644
--- a/recipes-phosphor/sensors/dbus-sensors/0106-Add-uring_args-for-all-build-targets-in-package.patch
+++ b/recipes-phosphor/sensors/dbus-sensors/0106-Add-uring_args-for-all-build-targets-in-package.patch
@@ -18,6 +18,10 @@
 values successfully. Services use random_access_file read sensor data
 successfully.
 
+Patch Tracking Bug: b/303793041
+Upstream info / review:  Accepted
+Justification: wait for the next rebase to pull in the changes from openbmc.
+
 Signed-off-by: Zhikui Ren <zhikui.ren@intel.com>
 Change-Id: I8cf3a9a0d1ffca459eb6c2c37e4e2220ce5100ac
 ---
diff --git a/recipes-phosphor/sensors/dbus-sensors_%.bbappend b/recipes-phosphor/sensors/dbus-sensors_%.bbappend
index 0659028..829b91e 100644
--- a/recipes-phosphor/sensors/dbus-sensors_%.bbappend
+++ b/recipes-phosphor/sensors/dbus-sensors_%.bbappend
@@ -13,6 +13,7 @@
   file://0010-dbus-sensors-Creating-association-between-inventory-.patch \
   file://0001-Add-Assosication-interfaces-for-cables.patch \
   file://0105-fansensor-add-npcm845-fan-type.patch \
+  file://0106-Add-uring_args-for-all-build-targets-in-package.patch \
 "
 
 # gBMC NVMe-MI support begins
@@ -65,7 +66,6 @@
   file://0045-nvmesensor-improve-handling-of-config-change.patch \
   file://0046-nvmesensor-release-resources-when-exit-poll.patch \
   file://0047-NVMed-Enable-Primary-controller-when-SC-is-empty.patch \
-  file://0048-Add-uring_args-for-all-build-targets-in-package.patch \
   file://0048-NVMe-Add-the-NVMe-Admin-interface-within-the-repo.patch \
   file://0049-nvmesensor-Limit-logPage-07-to-Area-1-and-2.patch \
   file://0050-nvmesensor-Add-FirmwareDownload-for-NVMe-devices.patch \
@@ -78,7 +78,7 @@
                                                '', d)}"
 SRC_URI:append:gbmc = " \
   ${@bb.utils.contains('PACKAGECONFIG', 'nvmesensor', '${nvmesensor_patches}', \
-  'file://0106-Add-uring_args-for-all-build-targets-in-package.patch', d)} \
+  '', d)} \
 "
 # gBMC NVMe-MI support ends