Commit Graph

978779 Commits

Author SHA1 Message Date
Badhri Jagan Sridharan
29be10211c FROMGIT: usb: typec: tcpci: Implement callback for apply_rc
APPLY RC is defined as ROLE_CONTROL.CC1 != ROLE_CONTROL.CC2 and
POWER_CONTROL.AutodischargeDisconnect is 0. When ROLE_CONTROL.CC1 ==
ROLE_CONTROL.CC2, set the other CC to OPEN.

Bug: 185300749
Fixes: f321a02cae ("usb: typec: tcpm: Implement enabling Auto Discharge disconnect support")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210517192112.40934-4-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7257fbc7c5
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: Icbd80e146e677f4d0509a9e59da0afe1fdd31ef2
2021-06-04 11:15:19 -07:00
Badhri Jagan Sridharan
750135f7ae FROMGIT: usb: typec: tcpm: Move TCPC to APPLY_RC state during PR_SWAP
When vbus auto discharge is enabled, TCPCI based TCPC transitions
into Attached.SNK/Attached.SRC state. During PR_SWAP, TCPCI based
TCPC would disconnect when partner changes power roles. TCPC has
to be moved APPLY RC state during PR_SWAP. This is done by
ROLE_CONTROL.CC1 != ROLE_CONTROL.CC2 and
POWER_CONTROL.AutodischargeDisconnect is 0. Once the swap sequence
is done, AutoDischargeDisconnect is re-enabled.

Bug: 185300749
Fixes: f321a02cae ("usb: typec: tcpm: Implement enabling Auto Discharge disconnect support")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210517192112.40934-3-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 59d4d06c8a
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I28b2307cb2c8ccaccc611303a95cfe00f9cae35a
2021-06-04 11:15:19 -07:00
Greg Kroah-Hartman
a7d161dc5a ANDROID: GKI: device.h: add rcu_head back to struct device_link
Commit 80dd33cf72 ("drivers: base: Fix device link removal") upstream
drops the rcu_head from struct device_link.  But we want to drag it back
here in the Android GKI kernel to be 'safe' for future changes where we
might want to switch back to the old method if testing does not work out
well.

This allows us to switch between the different methods in an ABI
compatible way.

Bug: 161946584
Reported-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If4a56bae6eebe3de5764052b603162071e81bce3
2021-06-04 11:15:18 -07:00
Rafael J. Wysocki
60ea20ed1e FROMGIT: drivers: base: Reduce device link removal code duplication
Reduce device link removal code duplication between the cases when
SRCU is enabled and when it is disabled by moving the only differing
piece of it (which is the removal of the link from the consumer and
supplier lists) into a separate wrapper function (defined differently
for each of the cases in question).

No intentional functional impact.

Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/4326215.LvFx2qVVIh@kreacher
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 0c8713153f
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 driver-core-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0946e6bfa011e765551903683a4a11e87398273c
2021-06-04 11:15:18 -07:00
Rafael J. Wysocki
cead4664c2 FROMGIT: drivers: base: Fix device link removal
When device_link_free() drops references to the supplier and
consumer devices of the device link going away and the reference
being dropped turns out to be the last one for any of those
device objects, its ->release callback will be invoked and it
may sleep which goes against the SRCU callback execution
requirements.

To address this issue, make the device link removal code carry out
the device_link_free() actions preceded by SRCU synchronization from
a separate work item (the "long" workqueue is used for that, because
it does not matter when the device link memory is released and it may
take time to get to that point) instead of using SRCU callbacks.

While at it, make the code work analogously when SRCU is not enabled
to reduce the differences between the SRCU and non-SRCU cases.

Fixes: 843e600b8a ("driver core: Fix sleeping in invalid context during device link deletion")
Cc: stable <stable@vger.kernel.org>
Reported-by: chenxiang (M) <chenxiang66@hisilicon.com>
Tested-by: chenxiang (M) <chenxiang66@hisilicon.com>
Reviewed-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/5722787.lOV4Wx5bFT@kreacher
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 80dd33cf72
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
 driver-core-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ied905bee2346bab71c8ebdc554e5f3f7836db516
2021-06-04 11:15:18 -07:00
Stanley Chu
fb57fa3d60 UPSTREAM: scsi: ufs-mediatek: Keep VCC always-on for specific devices
For some devices which need extra delay after VCC power down, VCC shall be
kept always-on in some MediaTek UFS platforms to ensure the stability of
such devices because the extra delay may not be enough in those platforms.

Bug: 188004633
Change-Id: I77a584101b7b4921fa1b7b91a6c5c4a05995a252
(cherry picked from commit b3f3d31a52)
Link: https://lore.kernel.org/r/20201207054955.24366-3-stanley.chu@mediatek.com
Reviewed-by: Andy Teng <andy.teng@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-06-04 11:15:18 -07:00
Stanley Chu
caa3c2bab0 UPSTREAM: scsi: ufs: Allow regulators being always-on
Introduce a flag "always_on" in struct ufs_vreg to allow vendors to keep
the regulator always-on.

Bug: 188004633
Change-Id: Ib54d7a19056e6fb4b9d3008ab7cbe0ab6fa23523
(cherry picked from commit f8162ac70e)
Link: https://lore.kernel.org/r/20201207054955.24366-2-stanley.chu@mediatek.com
Reviewed-by: Andy Teng <andy.teng@mediatek.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-06-04 11:15:18 -07:00
Zhen Lei
4ac5f3e178 UPSTREAM: scsi: ufs-mediatek: Use correct path to fix compile error
When the kernel is compiled with allmodconfig, the following error is
reported:

In file included from drivers/scsi/ufs/ufs-mediatek-trace.h:36:0,
                 from drivers/scsi/ufs/ufs-mediatek.c:28:
./include/trace/define_trace.h:95:42: fatal error: ./ufs-mediatek-trace.h: No such file or directory
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)

The comment in include/trace/define_trace.h specifies that:
TRACE_INCLUDE_PATH: Note, the path is relative to define_trace.h, not the
file including it. Full path names for out of tree modules must be used.

So without "CFLAGS_ufs-mediatek.o := -I$(src)", the current directory "."
is "include/trace/", the relative path of ufs-mediatek-trace.h is
"../../drivers/scsi/ufs/".

Bug: 188004633
Change-Id: Id7dfb7cce1ff0465bd417323e8be08f023a44cad
(cherry picked from commit 5213dc7940)
Link: https://lore.kernel.org/r/20201209063144.1840-2-thunder.leizhen@huawei.com
Fixes: ca1bb061d6 ("scsi: ufs-mediatek: Introduce event_notify implementation")
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <Stanley.Chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-06-04 11:15:18 -07:00
Stanley Chu
1898121800 UPSTREAM: scsi: ufs-mediatek: Introduce event_notify implementation
Introduce event_notify implementation on MediaTek UFS platform. A
vendor-specific tracepoint is added that can be used for debugging
purposes.

Bug: 188004633
Change-Id: Ie3d1f3f3651b9e81a1d28f287459746b93381969
(cherry picked from commit ca1bb061d6)
Link: https://lore.kernel.org/r/20201205115901.26815-5-stanley.chu@mediatek.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-06-04 11:15:18 -07:00
Stanley Chu
c88e6599d2 BACKPORT: scsi: ufs: Introduce event_notify variant function
Introduce event_notify variant function to allow vendor to get notification
of important events and connect to any proprietary debugging facilities.

Bug: 188004633
Change-Id: I7e23fb0842c1c114be97286627ea1c241d66ea31
(cherry picked from commit 172614a9d0)
[Stanley: Resolved minor conflict in drivers/scsi/ufs/ufshcd.c]
Link: https://lore.kernel.org/r/20201205115901.26815-4-stanley.chu@mediatek.com
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2021-06-04 11:15:17 -07:00
Greg Kroah-Hartman
f92f904d55 Revert "Revert "clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940""
This reverts commit cb23d3ef63.

Bring back the commit in 5.10.38 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Icaf7981dd39bc96ba917c7010d8ea728e6f62a4b
2021-06-04 11:15:17 -07:00
Greg Kroah-Hartman
e86d688e51 Revert "Revert "PM: runtime: Fix unpaired parent child_count for force_resume""
This reverts commit 6120544b9b.

Bring back the commit in 5.10.38 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I35e82241cf4bb9c4c8dcb0f2b155e9008d2a9095
2021-06-04 11:15:17 -07:00
Greg Kroah-Hartman
df50ab971a Revert "Revert "kyber: fix out of bounds access when preempted""
This reverts commit 59870a78d4.

Bring back the commit in 5.10.38 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic93df6ad7bb79dda947aedc31d23d69fcd97b7d7
2021-06-04 11:15:17 -07:00
Greg Kroah-Hartman
a993cac61a Revert "Revert "usb: typec: ucsi: Retrieve all the PDOs instead of just the first 4""
This reverts commit 4940c943b4.

Bring back the commit in 5.10.38 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I78d139da2a44bfbf81e2bf6127ce5bc7ea795c1f
2021-06-04 11:15:17 -07:00
Greg Kroah-Hartman
556758235b Revert "Revert "mm: fix struct page layout on 32-bit systems""
This reverts commit c34cd7750e.

Bring back the commit in 5.10.38 that broke the kabi.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I570fc31f9e1f196136bbbef479fb2413011ddf0e
2021-06-04 11:15:16 -07:00
Liangliang Li
e1611d8751 ANDROID: GKI: Enlarge OEM data reserved in task_struct
Enlarge OEM data reserved in struct task_struct to support OEM's
feature.

Bug: 188018141
Change-Id: I242459e0ecf327475bb4814110f89f160cca0ad1
Signed-off-by: Liangliang Li <liliangliang@vivo.com>
2021-06-04 11:15:16 -07:00
rongqianfeng
474a726efd ANDROID: GKI: add OEM data in cma struct
Add OEM data in cma struct to store and report additional information
for cma memory leak debugging.

Bug: 187861160

Change-Id: Iffb772d23ac30087cb561d8a8b7ad821b41c3840
Signed-off-by: rongqianfeng <rongqianfeng@vivo.com>
2021-06-04 11:15:16 -07:00
Can Guo
ab20ac9696 FROMGIT: scsi: ufs: Remove redundant checks of !hba in suspend/resume callbacks
Runtime and system suspend/resume can only come after hba probe invokes
platform_set_drvdata(pdev, hba), meaning hba cannot be NULL in these PM
callbacks, so remove the checks of !hba.

Link: https://lore.kernel.org/r/1614145010-36079-4-git-send-email-cang@codeaurora.org
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189457922
(cherry picked from commit 4d195dc451
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: Iddecfaff6fe8ea0f1f3a26c8a1dab3a5033b4f54
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:16 -07:00
Can Guo
523a4fd3f4 FROMGIT: scsi: ufs: Minor adjustments to error handling
In error handling prepare stage, after SCSI requests are blocked, do a
down/up_write(clk_scaling_lock) to clean up the queuecommand() path.
Meanwhile, stop eeh_work in case it disturbs error recovery. Moreover,
reset ufshcd_state at the entrance of ufshcd_probe_hba(), since it may be
called multiple times during error recovery.

Link: https://lore.kernel.org/r/1614145010-36079-2-git-send-email-cang@codeaurora.org
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189457922
(cherry picked from commit aa53f580e6
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: Ib707e7218dfcd62d361c824706c2f9e8ff30f03c
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:16 -07:00
Stanley Chu
8fbb826868 BACKPORT: FROMGIT: scsi: ufs: Clean up and refactor clk-scaling feature
Manipulate clock scaling related stuff only if the host capability supports
clock scaling feature to avoid redundant code execution.

Link: https://lore.kernel.org/r/20210120150142.5049-4-stanley.chu@mediatek.com
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit 348e1bc5f4
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
[Can Guo: Resolved minor conflict in ufshcd.c]
Change-Id: Ic005cc59500576a8cad2d354e00cbc100aef3f1d
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Stanley Chu
099309ec7b FROMGIT: scsi: ufs: Remove redundant null checking of devfreq instance
hba->devfreq is zero-initialized thus it is not required to check its
existence in ufshcd_add_lus() function which is invoked during
initialization only.

Link: https://lore.kernel.org/r/20210120150142.5049-3-stanley.chu@mediatek.com
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit b058fa8682
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: Ic91637050c684a67543499abdac9f7ab55d32a3a
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Stanley Chu
6440a2c00d FROMGIT: scsi: ufs: Refactor cancelling clkscaling works
Cancelling suspend_work and resume_work is only required while suspending
clk-scaling. Move these two invocations into ufshcd_suspend_clkscaling()
function.

Link: https://lore.kernel.org/r/20210120150142.5049-2-stanley.chu@mediatek.com
Reviewed-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit f9a7fa345a
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: I3b90e59294cce63923720227d08987c084d09478
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Can Guo
67eb703be2 FROMGIT: scsi: ufs: Give clk scaling min gear a value
The initialization of clk_scaling.min_gear was removed by mistake. This
change adds it back, otherwise clock scaling down would fail.

Link: https://lore.kernel.org/r/1611802172-37802-1-git-send-email-cang@codeaurora.org
Fixes: 4543d9d782 ("scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()")
Reported-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit 80d892f4b2
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: I5a236ad9f2a1f074cb140857e2d594483e4b9577
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Can Guo
0226db1f3a BACKPORT: FROMGIT: scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()
ufshcd_hba_exit() is always called after ufshcd_exit_clk_scaling() and
ufshcd_exit_clk_gating(). Move ufshcd_exit_clk_scaling/gating() to
ufshcd_hba_exit(). Meanwhile, add dedicated functions to initialize
and remove sysfs nodes of clock scaling/gating to make the code more
readable. Overall functionality remains same.

Link: https://lore.kernel.org/r/1611137065-14266-3-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit 4543d9d782
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
[Can Guo: Resolved minor conflict in ufshcd.c]
Change-Id: I1bbded3f2fd153105f2d0067dd142074c0b2eddd
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Can Guo
5ee06e06fb BACKPORT: FROMGIT: scsi: ufs: Protect some contexts from unexpected clock scaling
In contexts like suspend, shutdown, and error handling we need to
suspend devfreq to make sure these contexts won't be disturbed by
clock scaling.  However, suspending devfreq is not enough since users
can still trigger a clock scaling by manipulating the devfreq sysfs
nodes like min/max_freq and governor even after devfreq is
suspended. Moreover, mere suspending devfreq cannot synchroinze a
clock scaling which has already been invoked through these sysfs
nodes. Add one more flag in struct clk_scaling and wrap the entire
func ufshcd_devfreq_scale() with the clk_scaling_lock, so that we can
use this flag and clk_scaling_lock to control and synchronize clock
scaling invoked through devfreq sysfs nodes.

Link: https://lore.kernel.org/r/1611137065-14266-2-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit 0e9d4ca43b
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
[Can Guo: Resolved minor conflict in ufshcd.c]
Change-Id: Idf49ebddb71635c9d79f9954457a4834e8f7441f
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Can Guo
e0d506a786 FROMGIT: scsi: ufs: Stop hardcoding the scale down gear
Instead of hardcoding the scale down gear, make it a member of
the ufs_clk_scaling struct.

Link: https://lore.kernel.org/r/1606442334-22641-1-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit 29b87e92a2
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: I59c0dab392e25b900451284e424b6df82ed69b3a
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:15 -07:00
Can Guo
b9a049ac4e FROMGIT: Revert "Make sure clk scaling happens only when HBA is runtime ACTIVE"
Commit 73cc291c27 ("scsi: ufs: Make sure clk scaling happens only
when HBA is runtime ACTIVE") is no longer needed since commit
0e9d4ca43b ("scsi: ufs: Protect some contexts from unexpected clock
scaling") is a more mature fix to protect UFS LLD stability from clock
scaling invoked through sysfs nodes by users.

Link: https://lore.kernel.org/r/1611137065-14266-4-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189417930
(cherry picked from commit b02d51afca
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
Change-Id: I752b3611ca2b85b9ddd0cc457310ff4c57baa27b
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:14 -07:00
Can Guo
3a3b24ef29 BACKPORT: FROMGIT: scsi: ufs: Protect PM ops and err_handler from user access through sysfs
User layer may access sysfs nodes when system PM ops or error handling is
running. This can cause various problems. Rename eh_sem to host_sem and use
it to protect PM ops and error handling from user layer intervention.

Link: https://lore.kernel.org/r/1610594010-7254-3-git-send-email-cang@codeaurora.org
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Can Guo <cang@codeaurora.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

Bug: 189457922
(cherry picked from commit 9cd20d3f47
git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.14/scsi-queue)
[Can Guo: Resolved minor conflict in ufshcd.c]
Change-Id: I705627ce4c78849f8c21f96cb98e8f66a562c183
Signed-off-by: Can Guo <cang@codeaurora.org>
2021-06-04 11:15:14 -07:00
Badhri Jagan Sridharan
47149e58f4 ANDROID: Update the ABI xml and symbol list
Update the generic symbol list.

Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 1 Added variable

1 Added function:

  [A] 'function int __traceiter_android_vh_typec_tcpm_log(void*, const char*, bool*)'

1 Added variable:

  [A] 'tracepoint __tracepoint_android_vh_typec_tcpm_log'

Bug: 189792358
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Change-Id: I9980f2ff6e591a5b5f6b3076d65f7f37168567c7
2021-06-04 17:44:08 +00:00
Will Deacon
18eae90751 FROMGIT: timer_list: Print name of per-cpu wakeup device
With the introduction of per-cpu wakeup devices that can be used in
preference to the broadcast timer, print the name of such devices when
they are available.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-6-will@kernel.org
(cherry picked from commit 245a057fee tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 185092876
Change-Id: I39736cb43702430b722382c802603fdc4188a5c4
2021-06-04 18:33:43 +01:00
Will Deacon
41b08205cb FROMGIT: tick/broadcast: Program wakeup timer when entering idle if required
When configuring the broadcast timer on entry to and exit from deep idle
states, prefer a per-CPU wakeup timer if one exists.

On entry to idle, stop the tick device and transfer the next event into
the oneshot wakeup device, which will serve as the wakeup from idle. To
avoid the overhead of additional hardware accesses on exit from idle,
leave the timer armed and treat the inevitable interrupt as a (possibly
spurious) tick event.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-5-will@kernel.org
(cherry picked from commit ea5c7f1b9a tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 185092876
Change-Id: I62a49231e213285f95e9f0cf6a07633984930b56
2021-06-04 18:33:43 +01:00
Will Deacon
130cd0ecfa FROMGIT: tick/broadcast: Prefer per-cpu oneshot wakeup timers to broadcast
Some SoCs have two per-cpu timer implementations where the timer with the
higher rating stops in deep idle (i.e. suffers from CLOCK_EVT_FEAT_C3STOP)
but is otherwise preferable to the timer with the lower rating. In such a
design, selecting the higher rated devices relies on a global broadcast
timer and IPIs to wake up from deep idle states.

To avoid the reliance on a global broadcast timer and also to reduce the
overhead associated with the IPI wakeups, extend
tick_install_broadcast_device() to manage per-cpu wakeup timers separately
from the broadcast device.

For now, these timers remain unused.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-4-will@kernel.org
(cherry picked from commit c94a8537df tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 185092876
Change-Id: I2d2b1bc6333d004846270d3e58dec0dca89a89d1
2021-06-04 18:33:43 +01:00
Will Deacon
4b3ac410bc FROMGIT: tick/broadcast: Split __tick_broadcast_oneshot_control() into a helper
In preparation for adding support for per-cpu wakeup timers, split
_tick_broadcast_oneshot_control() into a helper function which deals
only with the broadcast timer management across idle transitions.

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-3-will@kernel.org

(cherry picked from commit e5007c288e tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 185092876
Change-Id: I14c5456ec1af0b8f73c85e9571f171ea1c3c564b
2021-06-04 18:33:43 +01:00
Will Deacon
fbcfac4490 FROMGIT: tick/broadcast: Drop unneeded CONFIG_GENERIC_CLOCKEVENTS_BROADCAST guard
tick-broadcast.o is only built if CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
so remove the redundant #ifdef guards around the definition of
tick_receive_broadcast().

Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210524221818.15850-2-will@kernel.org
(cherry picked from commit c2d4fee3f6 tip/tip.git timers/core)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 185092876
Change-Id: Ifb18a53bfad8d228f6f76c9b74c9bca8de27759a
2021-06-04 18:33:43 +01:00
Wesley Cheng
5621e45f70 FROMGIT: usb: gadget: f_fs: Ensure io_completion_wq is idle during unbind
During unbind, ffs_func_eps_disable() will be executed, resulting in
completion callbacks for any pending USB requests.  When using AIO,
irrespective of the completion status, io_data work is queued to
io_completion_wq to evaluate and handle the completed requests.  Since
work runs asynchronously to the unbind() routine, there can be a
scenario where the work runs after the USB gadget has been fully
removed, resulting in accessing of a resource which has been already
freed. (i.e. usb_ep_free_request() accessing the USB ep structure)

Explicitly drain the io_completion_wq, instead of relying on the
destroy_workqueue() (in ffs_data_put()) to make sure no pending
completion work items are running.

Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/1621644261-1236-1-git-send-email-wcheng@codeaurora.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 6fc1db5e62
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I53f5fedfb116bfd72eaedaeb33d2a4f6aeb12d4a
2021-06-04 14:50:06 +00:00
Li Jun
7b163b6295 FROMGIT: usb: typec: tcpm: cancel send discover hrtimer when unregister tcpm port
Like the state_machine_timer, we should also cancel possible pending
send discover identity hrtimer when unregister tcpm port.

Fixes: c34e85fa69 ("usb: typec: tcpm: Send DISCOVER_IDENTITY from dedicated work")
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-3-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 024236abeb
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4640c18af8d37cfa6fe666f586e5cb664a39cd62
2021-06-04 14:07:56 +00:00
Li Jun
f793ff4b81 FROMGIT: usb: typec: tcpm: cancel frs hrtimer when unregister tcpm port
Like the state_machine_timer, we should also cancel possible pending
frs hrtimer when unregister tcpm port.

Fixes: 8dc4bd0736 ("usb: typec: tcpm: Add support for Sink Fast Role SWAP(FRS)")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-2-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 7ade4805e2
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I9a651304c9a3c0be8475773c119d000b5cddfa0f
2021-06-04 14:02:46 +00:00
Li Jun
693c200239 FROMGIT: usb: typec: tcpm: cancel vdm and state machine hrtimer when unregister tcpm port
A pending hrtimer may expire after the kthread_worker of tcpm port
is destroyed, see below kernel dump when do module unload, fix it
by cancel the 2 hrtimers.

[  111.517018] Unable to handle kernel paging request at virtual address ffff8000118cb880
[  111.518786] blk_update_request: I/O error, dev sda, sector 60061185 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[  111.526594] Mem abort info:
[  111.526597]   ESR = 0x96000047
[  111.526600]   EC = 0x25: DABT (current EL), IL = 32 bits
[  111.526604]   SET = 0, FnV = 0
[  111.526607]   EA = 0, S1PTW = 0
[  111.526610] Data abort info:
[  111.526612]   ISV = 0, ISS = 0x00000047
[  111.526615]   CM = 0, WnR = 1
[  111.526619] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041d75000
[  111.526623] [ffff8000118cb880] pgd=10000001bffff003, p4d=10000001bffff003, pud=10000001bfffe003, pmd=10000001bfffa003, pte=0000000000000000
[  111.526642] Internal error: Oops: 96000047 [#1] PREEMPT SMP
[  111.526647] Modules linked in: dwc3_imx8mp dwc3 phy_fsl_imx8mq_usb [last unloaded: tcpci]
[  111.526663] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc4-00927-gebbe9dbd802c-dirty #36
[  111.526670] Hardware name: NXP i.MX8MPlus EVK board (DT)
[  111.526674] pstate: 800000c5 (Nzcv daIF -PAN -UAO -TCO BTYPE=--)
[  111.526681] pc : queued_spin_lock_slowpath+0x1a0/0x390
[  111.526695] lr : _raw_spin_lock_irqsave+0x88/0xb4
[  111.526703] sp : ffff800010003e20
[  111.526706] x29: ffff800010003e20 x28: ffff00017f380180
[  111.537156] buffer_io_error: 6 callbacks suppressed
[  111.537162] Buffer I/O error on dev sda1, logical block 60040704, async page read
[  111.539932]  x27: ffff00017f3801c0
[  111.539938] x26: ffff800010ba2490 x25: 0000000000000000 x24: 0000000000000001
[  111.543025] blk_update_request: I/O error, dev sda, sector 60061186 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[  111.548304]
[  111.548306] x23: 00000000000000c0 x22: ffff0000c2a9f184 x21: ffff00017f380180
[  111.551374] Buffer I/O error on dev sda1, logical block 60040705, async page read
[  111.554499]
[  111.554503] x20: ffff0000c5f14210 x19: 00000000000000c0 x18: 0000000000000000
[  111.557391] Buffer I/O error on dev sda1, logical block 60040706, async page read
[  111.561218]
[  111.561222] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
[  111.564205] Buffer I/O error on dev sda1, logical block 60040707, async page read
[  111.570887] x14: 00000000000000f5 x13: 0000000000000001 x12: 0000000000000040
[  111.570902] x11: ffff0000c05ac6d8
[  111.583420] Buffer I/O error on dev sda1, logical block 60040708, async page read
[  111.588978]  x10: 0000000000000000 x9 : 0000000000040000
[  111.588988] x8 : 0000000000000000
[  111.597173] Buffer I/O error on dev sda1, logical block 60040709, async page read
[  111.605766]  x7 : ffff00017f384880 x6 : ffff8000118cb880
[  111.605777] x5 : ffff00017f384880
[  111.611094] Buffer I/O error on dev sda1, logical block 60040710, async page read
[  111.617086]  x4 : 0000000000000000 x3 : ffff0000c2a9f184
[  111.617096] x2 : ffff8000118cb880
[  111.622242] Buffer I/O error on dev sda1, logical block 60040711, async page read
[  111.626927]  x1 : ffff8000118cb880 x0 : ffff00017f384888
[  111.626938] Call trace:
[  111.626942]  queued_spin_lock_slowpath+0x1a0/0x390
[  111.795809]  kthread_queue_work+0x30/0xc0
[  111.799828]  state_machine_timer_handler+0x20/0x30
[  111.804624]  __hrtimer_run_queues+0x140/0x1e0
[  111.808990]  hrtimer_interrupt+0xec/0x2c0
[  111.813004]  arch_timer_handler_phys+0x38/0x50
[  111.817456]  handle_percpu_devid_irq+0x88/0x150
[  111.821991]  __handle_domain_irq+0x80/0xe0
[  111.826093]  gic_handle_irq+0xc0/0x140
[  111.829848]  el1_irq+0xbc/0x154
[  111.832991]  arch_cpu_idle+0x1c/0x2c
[  111.836572]  default_idle_call+0x24/0x6c
[  111.840497]  do_idle+0x238/0x2ac
[  111.843729]  cpu_startup_entry+0x2c/0x70
[  111.847657]  rest_init+0xdc/0xec
[  111.850890]  arch_call_rest_init+0x14/0x20
[  111.854988]  start_kernel+0x508/0x540
[  111.858659] Code: 910020e0 8b0200c2 f861d884 aa0203e1 (f8246827)
[  111.864760] ---[ end trace 308b9a4a3dcb73ac ]---
[  111.869381] Kernel panic - not syncing: Oops: Fatal exception in interrupt
[  111.876258] SMP: stopping secondary CPUs
[  111.880185] Kernel Offset: disabled
[  111.883673] CPU features: 0x00001001,20000846
[  111.888031] Memory Limit: none
[  111.891090] ---[ end Kernel panic - not syncing: Oops: Fatal exception in interrupt ]---

Fixes: 3ed8e1c2ac ("usb: typec: tcpm: Migrate workqueue to RT priority for processing events")
Cc: stable <stable@vger.kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Li Jun <jun.li@nxp.com>
Link: https://lore.kernel.org/r/1622627829-11070-1-git-send-email-jun.li@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3a13ff7ef4
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I4fae27939edca3a9c09020e6252c96ae373eaaf2
2021-06-04 14:02:30 +00:00
Kyle Tso
e4046d6ecc FROMGIT: usb: typec: tcpm: Properly handle Alert and Status Messages
When receiving Alert Message, if it is not unexpected but is
unsupported for some reason, the port should return Not_Supported
Message response.

Also, according to PD3.0 Spec 6.5.2.1.4 Event Flags Field, the
OTP/OVP/OCP flags in the Event Flags field in Status Message no longer
require Get_PPS_Status Message to clear them. Thus remove it when
receiving Status Message with those flags being set.

In addition, add the missing AMS operations for Status Message.

Fixes: 64f7c494a3 ("typec: tcpm: Add support for sink PPS related messages")
Fixes: 0908c5aca3 ("usb: typec: tcpm: AMS and Collision Avoidance")
Signed-off-by: Kyle Tso <kyletso@google.com>
Link: https://lore.kernel.org/r/20210531164928.2368606-1-kyletso@google.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 063933f47a
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I0d3d3ed90758e39b033082001f2e9f782cfc26ef
2021-06-04 14:02:23 +00:00
fengmingli
e3e4ee0e9f ANDROID: usb: export tracepoint for dwc3_complete_trb
Export dwc3_complete_trb tracepoint so that
vendor modules can use it.

Bug: 189130101

Change-Id: I1efeaf2a29267ee647fda83d5f18b7a5fae16b96
Signed-off-by: fengmingli <mingli.feng@vivo.com>
2021-06-04 11:39:43 +00:00
liuwei.a
da4b3a9637 ANDROID: GKI: Request enable some kernel configs for background speed limit function
Change reason:to support the background speed limit function, we need to enable the configs as follow:
CONFIG_NET_SCH_MULTIQ=y
CONFIG_NET_SCH_NETEM=y
CONFIG_CLS_U32_MARK=y
CONFIG_NET_CLS_FLOW=y
CONFIG_NET_EMATCH_CMP=y
CONFIG_NET_EMATCH_NBYTE=y
CONFIG_NET_EMATCH_META=y
CONFIG_NET_EMATCH_TEXT=y
CONFIG_NET_ACT_SKBEDIT=y

Bug: 189705988
Signed-off-by: Wei Liu <liuwei.a@oppo.com>
Change-Id: I6f9a627bc2a2197b0da8a371ccd2a762b3147fc1
2021-06-04 10:31:48 +00:00
Liujie Xie
016d3f7b69 ANDROID: vendor_hooks: Export the tracepoints task_rename
Export the tracepoint task_rename and let module probe it.

Bug: 189985971

Change-Id: I3bb71eae316e3096d361e7b47012ba46ea4be509
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
2021-06-04 06:26:01 +00:00
Saravana Kannan
f2d87eb3a0 Revert "Revert "ANDROID: usb: dwc3: gadget: don't cancel the started requests""
This reverts commit 17f230fd93.

Reason for revert: adb connection is unstable on Mac C-C setup and breaking
the workflow for a lot of people.

We can revert this later if we find and fix any userspace issues that might
be causing this.

Bug: 188778499
Change-Id: I9507207b4093d3eba25132657c84ecf7407d6df9
Signed-off-by: Saravana Kannan <saravanak@google.com>
2021-06-03 22:42:28 +00:00
Charan Teja Reddy
3bcdb496f4 ANDROID: signal: Add vendor hook for memory reaping
Add vendor hook to determine if the memory of a process that received
the SIGKILL can be reaped.

Bug: 189803002
Change-Id: Ie6802b9bf93ddffb0ceef615d7cca40c23219e57
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
2021-06-03 20:59:15 +00:00
Charan Teja Reddy
3f491d10dc Revert "ANDROID: mm: oom_kill: reap memory of a task that receives SIGKILL"
This reverts commit a7af91adc7 ("ANDROID: mm: oom_kill: reap memory of
a task that receives SIGKILL") as this functionality is moved to vendor
hook based approach.

Bug: 189803002
Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
Change-Id: Ica0d6df22fb81bf430e9b4c7d12b36ab7d44dab8
2021-06-03 20:59:06 +00:00
Marco Elver
4794cb419d FROMGIT: kfence: unconditionally use unbound work queue
Unconditionally use unbound work queue, and not just if wq_power_efficient
is true.  Because if the system is idle, KFENCE may wait, and by being run
on the unbound work queue, we permit the scheduler to make better
scheduling decisions and not require pinning KFENCE to the same CPU upon
waking up.

Link: https://lkml.kernel.org/r/20210521111630.472579-1-elver@google.com
Fixes: 36f0b35d08 ("kfence: use power-efficient work queue to run delayed work")
Signed-off-by: Marco Elver <elver@google.com>
Reported-by: Hillf Danton <hdanton@sina.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

Bug: 181822795
Test: Treehugger
(cherry picked from commit bc900b3d574f9a630e9d05cf61383e999ca3b091
 https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git akpm)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I5f2029cb8b95fd97851615608520add94c602a18
2021-06-03 20:52:39 +00:00
Masami Hiramatsu
cdd895c318 FROMLIST: bootconfig: Share the checksum function with tools
Move the checksum calculation function into the header for sharing it
with tools/bootconfig.

Picking this up FROMLIST to get the fix ASAP. It is likely to be
accepted upstream.

Signed-off-by: Devin Moore <devinmoore@google.com>
Link: https://lore.kernel.org/lkml/162262192121.264090.6540508908529705156.stgit@devnote2/
Bug: 183237066
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Change-Id: Ifd79a0fc7d75bde733ffe8f979c7e30e4c5844c7
2021-06-03 19:57:28 +00:00
Masami Hiramatsu
88fa7f8bf0 FROMLIST: docs: bootconfig: Update for mixing value and subkeys
Update document for the mixing value and subkeys on a key.

Picking this up FROMLIST to get the fix ASAP. It is likely to be
accepted upstream.

Signed-off-by: Devin Moore <devinmoore@google.com>
Link: https://lore.kernel.org/lkml/162262192121.264090.6540508908529705156.stgit@devnote2/
Bug: 183237066
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Change-Id: Ic0f92d57aae62b6efd762db71da4e83c9d96b5e4
2021-06-03 19:57:18 +00:00
Masami Hiramatsu
0b3bf71fa3 FROMLIST: tools/bootconfig: Support mixed value and subkey test cases
Update test case to support mixed value and subkey on a key.

Picking this up FROMLIST to get the fix ASAP. It is likely to be
accepted upstream.

Signed-off-by: Devin Moore <devinmoore@google.com>
Link: https://lore.kernel.org/lkml/162262192121.264090.6540508908529705156.stgit@devnote2/
Bug: 183237066
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Change-Id: I42bb63afb9d7c3e3cd3e3c3a87d41db59bf27043
2021-06-03 19:57:10 +00:00
Masami Hiramatsu
a504731003 FROMLIST: bootconfig: Support mixing a value and subkeys under a key
Support mixing a value and subkeys under a key. Since kernel cmdline
options will support "aaa.bbb=value1 aaa.bbb.ccc=value2", it is
better that the bootconfig supports such configuration too.

Note that this does not change syntax itself but just accepts
mixed value and subkeys e.g.

key = value1
key.subkey = value2

But this is not accepted;

key {
 value1
 subkey = value2
}

That will make value1 as a subkey.

Also, the order of the value node under a key is fixed. If there
are a value and subkeys, the value is always the first child node
of the key. Thus if user specifies subkeys first, e.g.

key.subkey = value1
key = value2

In the program (and /proc/bootconfig), it will be shown as below

key = value2
key.subkey = value1

Picking this up FROMLIST to get the fix ASAP. It is likely to be
accepted upstream.

Signed-off-by: Devin Moore <devinmoore@google.com>
Link: https://lore.kernel.org/lkml/162262192121.264090.6540508908529705156.stgit@devnote2/
Bug: 183237066
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Change-Id: I60bdc229c5162efc55fe2e40c75c993f0f27ac18
2021-06-03 19:57:01 +00:00