Commit Graph

1147308 Commits

Author SHA1 Message Date
Asutosh Das
2be21deeeb FROMGIT: scsi: ufs: core: Probe for EXT_IID support
Task Tag is limited to 8 bits and this restricts the number of active I/Os
to 255.  In multi-circular queue mode, this may not be enough.  The
specification provides EXT_IID which can be used to increase the number of
I/Os if the UFS device and UFSHC support it.  This patch adds support to
probe for EXT_IID support in UFS device and UFSHC.

Co-developed-by: Can Guo <quic_cang@quicinc.com>
Change-Id: I6f9301853c590fb635246f3225fb8577f7489b3b
Signed-off-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Asutosh Das <quic_asutoshd@quicinc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 6e1d850acf git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bean Huo
d4ffeb41f5 FROMGIT: scsi: core: Fix invisible definition compilation warning
In 'include/ufs/ufshcd.h' file, 'enum dma_data_direction' will be used,
which is defined in linux/dma-direction.h, however, this header file is not
included in ufshcd.h, thus causing the following compilation warning:

"warning: ‘enum dma_data_direction’ declared inside parameter list will not
be visible outside of this definition or declaration"

Fix this warning by including 'linux/dma-direction.h'.

Fixes: 6ff265fc5e ("scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg")
Reported-by: Xiaosen He <quic_xiaosenh@quicinc.com>
Reported-by: Bart Van Assche <bvanassche@acm.org>
Change-Id: I82d66b5cfb2c16912d74b2ed1f7315d811e3e3ce
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit f3e57da528 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bean Huo
e9e191893d FROMGIT: scsi: ufs: core: bsg: Fix sometimes-uninitialized warnings
Compilation complains that two possible variables are used without
initialization:

drivers/ufs/core/ufs_bsg.c:112:6: warning: variable 'sg_cnt' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
drivers/ufs/core/ufs_bsg.c:112:6: warning: variable 'sg_list' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

Fix both warnings by adding initialization with sg_cnt = 0, sg_list = NULL.

Fixes: 6ff265fc5e ("scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg")
Change-Id: I6b53eb42ee00f2ea16d352dc75eb3d9dee2890b3
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Xiaosen He <quic_xiaosenh@quicinc.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 5e87c51f18 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
15afcce590 FROMGIT: scsi: ufs: ufs-qcom: Add support for finding max gear on new platforms
Starting from Qcom UFS version 4.0, vendor specific REG_UFS_PARAM0 register
can be used to determine the maximum gear supported by the controller.

Suggested-by: Can Guo <quic_cang@quicinc.com>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: Ice5a7fd56b090041cad570a341e95e53f9d53485
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 2c407fe970 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
e2379e8f90 FROMGIT: scsi: ufs: ufs-qcom: Add support for reinitializing the UFS device
Starting from Qualcomm UFS version 4, the UFS device needs to be
reinitialized after switching to maximum gear by the UFS core. Hence, add
support for it by enabling the UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH
quirk, implementing reinit_notify() callback and using the agreed gear
speed for setting the PHY mode.

Suggested-by: Can Guo <quic_cang@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I0f4c6d840734f9966870d2d3636a934165fd13c3
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit baf5ddac90 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
dcbf4ebcac FROMGIT: scsi: ufs: ufs-qcom: Factor out the logic finding the HS Gear
In the preparation of adding support for new gears, move the logic that
finds the gear for each platform to a new function. This helps with code
readability and also allows the logic to be used in other places of the
driver in future.

While at it, make it clear that this driver only supports symmetric gear
setting (hs_tx_gear == hs_rx_gear).

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I84a9ba276db78e041bc9913e1d6554e05da4023b
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit c270986527 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
6228fc0812 FROMGIT: scsi: ufs: core: Add reinit_notify() callback
reinit_notify() callback can be used by the UFS controller drivers to
perform changes required for UFSHCD reinit that can happen during max gear
switch.

Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: Ib9cf5903405eab16a14ed55e17b6505592de711b
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit c2c38c573a git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
29b2465d55 FROMGIT: scsi: ufs: ufs-qcom: Fix the Qcom register name for offset 0xD0
On newer UFS revisions, the register at offset 0xD0 is called,
REG_UFS_PARAM0. Since the existing register, RETRY_TIMER_REG is not used
anywhere, it is safe to use the new name.

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: Ia5387b6687e410a4d08d992c4da246063232dcb9
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 7959587f32 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
0a4c843cf4 FROMGIT: scsi: ufs: ufs-qcom: Use dev_err_probe() for printing probe error
Make use of dev_err_probe() for printing the probe error.

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I905e177e899ff1b1e3e805536cc6259f244aebb0
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 132b027205 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
151dcfb0c9 FROMGIT: scsi: ufs: ufs-qcom: Use bitfields where appropriate
Use bitfield macros where appropriate to simplify the driver.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I5736fb282277a78f13329641e40e67217a169b62
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 18fe2ab79b git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
b8697b11af FROMGIT: scsi: ufs: ufs-qcom: Remove unnecessary WARN_ON()
In the reset assert and deassert callbacks, the supplied "id" is not used
at all and only the HBA reset is performed all the time. So there is no
reason to use a WARN_ON() on the "id".

Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I2979206c0c765d9cb3317550a83092bbb17d3bc8
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit a98c2183e8 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Manivannan Sadhasivam
8bdd3e967a FROMGIT: scsi: ufs: ufs-qcom: Remove unnecessary goto statements
A goto statement in an error path is useful if the function needs to do
cleanup other than returning the error code. But in this driver, goto
statements are used for just returning the error code in many places. This
really makes it hard to read the code.

Get rid of those goto statements and just return the error code directly.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Change-Id: I634e2abe6bc4b22aa9779cc04149edd9cce7290c
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 031312dbc6 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Zhe Wang
07c1883003 FROMGIT: scsi: ufs: ufs-unisoc: Add support for Unisoc UFS host controller
Add driver code for Unisoc UFS host controller, along with UFS
initialization.

Change-Id: Id267c2a328538fc9d6d6f87c74502705bc9c93c0
Signed-off-by: Zhe Wang <zhe.wang1@unisoc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit df7320bac3 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Arthur Simchaev
dfea4f5957 FROMGIT: scsi: ufs: core: Remove ufshcd_map_desc_id_to_length()
There shouldn't be any restriction of the descriptor size (not the
descriptor id for that matter) up to QUERY_DESC_MAX_SIZE.  According to the
spec, the caller can use any descriptor size, and it is up to the device to
return the actual size.  Therefore there shouldn't be any sizes hardcoded
in the kernel, nor any need to cache it, hence the
ufshcd_map_desc_id_to_length() function is redundant. Always read the
descriptors with QUERY_DESC_MAX_SIZE size.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Suggested-by: Bean Huo <beanhuo@micron.com>
Change-Id: Ie8377548c09155285dc9b5f249bfad1e3aceacee
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 16ed9d312b git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Arthur Simchaev
1e7f8732e3 FROMGIT: scsi: ufs: core: Remove len parameter from ufshcd_set_active_icc_lvl()
len argument is not used anymore in ufshcd_set_active_icc_lvl() function.

Change-Id: I67c60c25c0602bdbae0a71c28582106b155528c1
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 01a0d515b7 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Arthur Simchaev
5fa38e940f FROMGIT: scsi: ufs: core: Remove redundant desc_size variable from hba
Always read the descriptor with QUERY_DESC_MAX_SIZE.  According to the
spec, the device returns the actual size.

Change-Id: Ibc1fbd523e54f187057a69754c8e4141cc48a902
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit f2a89b071b git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Arthur Simchaev
5e94c4a56d FROMGIT: scsi: ufs: core: Remove redundant wb check
We used to use the extended-feature field in the device descriptor as an
indication that the device supported UFS 2.2 or later.  Remove that as this
check is specifically done few lines above.

Change-Id: I864d2f0e4d30c52823b755defd0c372ce89fd2eb
Signed-off-by: Arthur Simchaev <Arthur.Simchaev@wdc.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 358ae02f47 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Eric Biggers
afec113486 FROMGIT: scsi: ufs: core: Allow UFS host drivers to override the sg entry size
Modify the UFSHCD core to allow 'struct ufshcd_sg_entry' to be
variable-length. The default is the standard length, but variants can
override ufs_hba::sg_entry_size with a larger value if there are
vendor-specific fields following the standard ones.

This is needed to support inline encryption with ufs-exynos (FMP).

Cc: Eric Biggers <ebiggers@google.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Change-Id: I8b4e2f2be2448fc50b3fe4cb928c4e835a6e0a1a
Signed-off-by: Eric Biggers <ebiggers@google.com>
[ bvanassche: edited commit message and introduced CONFIG_SCSI_UFS_VARIABLE_SG_ENTRY_SIZE ]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit ada1e653a5 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
511cfcf182 FROMGIT: scsi: ufs: core: Pass the clock scaling timeout as an argument
Prepare for adding an additional ufshcd_clock_scaling_prepare() call with a
different timeout.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Change-Id: I598d940c34b70b8fa05e4039fcd651ecf601208f
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit b434ecfb73 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
8c47a2d09f FROMGIT: scsi: ufs: core: Reduce the clock scaling latency
Wait at most 20 ms before rechecking the doorbells instead of waiting for a
potentially long time between doorbell checks.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Change-Id: I570f8eb9ecf3cc75252574695dcea4d162381fc0
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 2000bc3097 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Andrew Halaney
2029876721 FROMGIT: scsi: ufs: ufs-qcom: Use dev_err() where possible
dev_err() statements are better to use than pr_err(), so switch to those.

In a similar vein, the check on the dev_req_params pointer here is not
needed, the two places this function is called never pass in a NULL
pointer, so instead of using dev_err() there just remove it.

Change-Id: If1d59ac6f75922fbc1e5f910ed7a849f20bf5f42
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 1026f7d366 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Andrew Halaney
58bb10cfd1 FROMGIT: scsi: ufs: ufs-qcom: Remove usage of dbg_print_en
This bitmask is unconditionally set in the current driver, so all
conditionals using it can be considered bit rot.

Let's take the current default conditional path everywhere and remove
dbg_print_en from the driver.

Change-Id: I1fe4849dd8ae05219af085f7e905a11397e4b4ed
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit e4ce23fba3 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Andrew Halaney
b57119198d FROMGIT: scsi: ufs: ufs-qcom: Clean up dbg_register_dump
The current implementation has abstractions that don't give any benefits.

The print_fn callback (and its only callback implementation,
ufs_qcom_dump_regs_wrapper()) was only used by
ufs_qcom_print_hw_debug_reg_all() and just multiplies len by 4 before
calling ufshcd_dump_regs().

ufs_qcom_print_hw_debug_reg_all() is only called by
ufs_qcom_dump_dbg_regs().

There's no real gain in those abstractions, so let's just do the work
directly in ufs_qcom_dump_dbg_regs() (the dbg_register_dump callback).

Change-Id: I61081d0aa4243ac87dc73abce7b05959252df91f
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 50a427a00c git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Andrew Halaney
303217c42a FROMGIT: scsi: ufs: ufs-qcom: Drop unnecessary NULL checks
This code path is only called through one function, and the HBA struct is
already accessed in ufshcd_vops_dbg_register_dump() prior to calling so
there is no way for it to be NULL.

Likewise, the print_fn callback is always supplied within this driver and
is always provided.

Change-Id: Ia7206fdffcc16528bfa1a8a84112bc0e503affa9
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Asutosh Das <quic_asutoshd@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 921a880827 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bean Huo
4415633471 FROMGIT: scsi: ufs: core: bsg: Add advanced RPMB support in ufs_bsg
Add advanced RPMB support in ufs_bsg:

 1. According to the UFS specification, only one RPMB operation can be
    performed at any time. We can ensure this by using reserved slot and
    its dev_cmd sync operation protection mechanism.

 2. For Advanced RPMB, RPMB metadata is packaged in an EHS (Extra Header
    Segment) of a command UPIU, and the corresponding reply EHS (from the
    device) should also be returned to the user space.  bsg_job->request
    and bsg_job->reply allow us to pass and return EHS from/back to
    userspace.

Compared to normal/legacy RPMB, the advantages of advanced RPMB are:

 1. The data length in the Advanced RPMB data read/write command can be
    larger than 4KB. For the legacy RPMB, the data length in a single RPMB
    data transfer is 256 bytes.

 2. All of the advanced RPMB operations will be a single command. For
    legacy RPMB, take the read write-counter value as an example, you need
    two commands (first SECURITY PROTOCOL OUT, then second SECURITY
    PROTOCOL IN).

Change-Id: Ia1aeab52f54ecc163e98736551c007c452991b4c
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 6ff265fc5e git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bean Huo
1c51a64e54 FROMGIT: scsi: ufs: core: Pass EHS length into ufshcd_prepare_req_desc_hdr()
We need to fill in the total EHS length in UTP Transfer Request Descriptor.
Add this functionality to ufshcd_prepare_req_desc_hdr().

Change-Id: Ic9a8f3ccfafc764655869144292c64efc3048157
Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit a4b1c9b9b3 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bean Huo
799847349c FROMGIT: scsi: ufs: core: Advanced RPMB detection
Check UFS Advanced RPMB LU enablement during ufshcd_lu_init().

Change-Id: I4b78b51d1240347b0075f667e86f964551616c83
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit f6b9d0fe5c git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Keoseong Park
4382047a5f FROMGIT: scsi: ufs: core: Remove check_upiu_size() from ufshcd.h
Commit 68078d5cc1 ("[SCSI] ufs: Set fDeviceInit flag to initiate device
initialization") added check_upiu_size(), but no caller.

Cc: Dolev Raviv <draviv@codeaurora.org>
Link: https://lore.kernel.org/r/20221103055349epcms2p338f2550c2dd78d00231a83b24719a3d4@epcms2p3
Change-Id: I6272c971838eb344100486951a03465b86035326
Signed-off-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 3d6d793092 git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
8980864315 FROMGIT: scsi: ufs: Fix a deadlock between PM and the SCSI error handler
The following deadlock has been observed on multiple test setups:

 * ufshcd_wl_suspend() is waiting for blk_execute_rq(START STOP UNIT) to
   complete while ufshcd_wl_suspend() holds host_sem.

 * The SCSI error handler is activated, changes the host state to
   SHOST_RECOVERY, ufshcd_eh_host_reset_handler() and ufshcd_err_handler()
   are called and the latter function tries to obtain host_sem.

This is a deadlock because blk_execute_rq() can't execute SCSI commands
while the host is in the SHOST_RECOVERY state and because the error handler
cannot make progress because host_sem is held by another thread.

Fix this deadlock as follows:

 * Fail attempts to suspend the system while the SCSI error handler is in
   progress by setting the SCMD_FAIL_IF_RECOVERING flag for START STOP UNIT
   commands.

 * If the system is suspending and a START STOP UNIT command times out,
   handle the SCSI command timeout from inside the context of the SCSI
   timeout handler instead of activating the SCSI error handler.

The runtime power management code is not affected by this deadlock since
hba->host_sem is not touched by the runtime power management functions in
the UFS driver.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Change-Id: I815c978c7857cc0f2c838d4d5eb68502a1591f8a
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221018202958.1902564-11-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 7029e2151a git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
f94c46ddc3 FROMGIT: scsi: ufs: Track system suspend / resume activity
Add a new boolean variable that tracks whether the system is suspending,
suspended or resuming. This information will be used in a later commit to
fix a deadlock between the SCSI error handler and the suspend code.

Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Change-Id: I860fd6119b22507e9932ac12dc7a84b0f228e352
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221018202958.1902564-9-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 1a547cbc6f git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
359585d690 FROMGIT: scsi: core: Support failing requests while recovering
The current behavior for SCSI commands submitted while error recovery is
ongoing is to retry command submission after error recovery has finished.
See also the scsi_host_in_recovery() check in scsi_host_queue_ready(). Add
support for failing SCSI commands while host recovery is in progress. This
functionality will be used to fix a deadlock in the UFS driver.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mike Christie <michael.christie@oracle.com>
Cc: Hannes Reinecke <hare@suse.de>
Change-Id: Iaf3c5d5a27aeaa9db8bdf8444c6ce67ca29988e8
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221018202958.1902564-4-bvanassche@acm.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit 310bcaef6d git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Bart Van Assche
22cf11e162 FROMGIT: scsi: core: Change the return type of .eh_timed_out()
Commit 6600593cbd ("block: rename BLK_EH_NOT_HANDLED to BLK_EH_DONE")
made it impossible for .eh_timed_out() implementations to call
scsi_done() without causing a crash.

Restore support for SCSI timeout handlers to call scsi_done() as follows:

 * Change all .eh_timed_out() handlers as follows:

   - Change the return type into enum scsi_timeout_action.
   - Change BLK_EH_RESET_TIMER into SCSI_EH_RESET_TIMER.
   - Change BLK_EH_DONE into SCSI_EH_NOT_HANDLED.

 * In scsi_timeout(), convert the SCSI_EH_* values into BLK_EH_* values.

Reviewed-by: Lee Duncan <lduncan@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Mike Christie <michael.christie@oracle.com>
Cc: Hannes Reinecke <hare@suse.de>
Change-Id: Iab1cf8cd14497bf66bcc0264f89bd890c9b2bed7
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20221018202958.1902564-3-bvanassche@acm.org
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 267974767
(cherry picked from commit dee7121e8c git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next)
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-03-15 16:17:14 +00:00
Yifan Hong
c312d9f39a ANDROID: Disable AF_RXRPC for allmodconfig.
AF_RXRPC imposes a 49 char limit on UTS_RELEASE, but building with

  BUILD_NUMBER=P12345678 bazel build //common:kernel_x86_64_allmodconfig --config=stamp

requires more than 49 chars in UTS_RELEASE. Hence, this module
is disabled for allmodconfig.

Bug: 273576197
Test: ABTD
Change-Id: Ife604db109f870eda2fdbc0668d6bd1f4e4e906e
Signed-off-by: Yifan Hong <elsk@google.com>
2023-03-15 14:09:33 +00:00
Sangmoon Kim
4c9611315b UPSTREAM: arm64: pass ESR_ELx to die() of cfi_handler
Commit 0f2cb928a1 ("arm64: consistently pass ESR_ELx to die()") caused
all callers to pass the ESR_ELx value to die().

For consistency, this patch also adds esr to die() call of cfi_handler.
Also, when CFI error occurs, die handlers can use ESR_ELx value.

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230220073441.2753-1-sangmoon.kim@samsung.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

Bug: 273333300
Change-Id: If0998121dbd821b844523fd05f70946a2050a9d7
(cherry picked from commit b61b82f81e)
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
2023-03-15 08:29:59 +00:00
Bart Van Assche
caaf86eb39 UPSTREAM: block: Fix the blk_mq_destroy_queue() documentation
Commit 2b3f056f72 moved a blk_put_queue() call from
blk_mq_destroy_queue() into its callers. Reflect this change in the
documentation block above blk_mq_destroy_queue().

Bug: 254441685
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Chaitanya Kulkarni <kch@nvidia.com>
Cc: Keith Busch <kbusch@kernel.org>
Fixes: 2b3f056f72 ("blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20230130211233.831613-1-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 81ea42b9c3)
Signed-off-by: Lee Jones <joneslee@google.com>
Change-Id: Ibcab4eba7ae8980f4b1f54918d1a32712437525c
2023-03-14 17:58:01 +00:00
Greg Kroah-Hartman
5b483d8a04 Merge changes I95ce33fb,I03723a9f,I4b1cf7f1,I6e17c9b3,I446172f8, ... into android14-6.1
* changes:
  Merge 6.1.17 into android14-6.1
  ANDROID: update abi definition due to io_uring changes.
  UPSTREAM: Revert "blk-cgroup: dropping parent refcount after pd_free_fn() is done"
  UPSTREAM: Revert "blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()"
  Revert "kobject: modify kobject_get_path() to take a const *"
  Revert "wait: Return number of exclusive waiters awaken"
  Revert "sbitmap: Use single per-bitmap counting to wake up queued tags"
  Revert "sbitmap: correct wake_batch recalculation to avoid potential IO hung"
  Revert "sbitmap: Advance the queue index before waking up a queue"
  Revert "sbitmap: Try each queue to wake up at least one waiter"
  Revert "HID: retain initial quirks set up when creating HID devices"
  Merge 6.1.16 into android14-6.1
2023-03-14 17:38:04 +00:00
Vincent Donnefort
78eb724c37 ANDROID: KVM: arm64: pKVM module loading before deprivilege
kvm-arm.protected_modules="" takes a list of modules that pKVM will load
before de-privileging the host. This is necessary as no loading will be
allowed later.

We can't rely on request_module() that might be disabled by umh's
configuration. Instead, create our own version, locked by the pKVM/KVM
static keys and marked as __init to be cleared once the kernel init is
done. Belt and braces.

Keep the previous kvm-arm.protected_modules for compatibility.

Bug: 254835242
Change-Id: Ia6881b4c7a60cf81d19ead12c5d4638a27eff3eb
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-03-14 13:33:39 +00:00
Vincent Donnefort
e3ad2ce3fb ANDROID: KVM: arm64: Move pKVM host deprivilege to device_initcall
In preparation for early loading of pKVM modules (i.e. before
deprivilege), move the pKVM finalization in device_initcall. This is
needed as modules are found in the initramfs whom unpack starts in the
previous initcall.

A deprivilege failure now ends-up in erasing the PVM firmware and simply
prevent loading of any protected VM.

As an interesting side effect, it also allows us to mark the module
loading functions as __init.  Those functions will then be erased once
the init is complete, reducing the attack surface.

Bug: 254835242
Change-Id: Ifab4b9167b8924222bc8b6c2a0af529a3f8540c0
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-03-14 13:33:39 +00:00
Vincent Donnefort
bf019165fe ANDROID: KVM: arm64: Cleanup useless declarations
While introducing ("KVM: arm64: Rework pKVM module locking") some bits
have been missed. Remove them.

Bug: 254835242
Change-Id: Ib2b5c84c6d900cfa452232c9ec62483dd230af0c
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-03-14 09:08:30 +00:00
Vincent Donnefort
425c421e77 ANDROID: CONFIG_MODPROBE_PATH to toolbox's modprobe
Early loading of pKVM modules (i.e. before deprivilege) implies to let
the kernel call modprobe. Notice this doesn't really enable
request_module: UMH is still "disabled" due to
CONFIG_STATIC_USERMODEHELPER_PATH="".

Bug: 254835242
Change-Id: I753ac4177e5017f7d913804bb8439f676d7c2fd8
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
2023-03-14 09:08:30 +00:00
Sangmoon Kim
68e294c322 ANDROID: ABI: update symbol list for galaxy
12 function symbol(s) added
  'int __traceiter_android_rvh_arm64_serror_panic(void*, struct pt_regs*, unsigned long)'
  'int __traceiter_android_rvh_die_kernel_fault(void*, const char*, unsigned long, unsigned long, struct pt_regs*)'
  'int __traceiter_android_rvh_do_el1_bti(void*, struct pt_regs*, unsigned long)'
  'int __traceiter_android_rvh_do_el1_fpac(void*, struct pt_regs*, unsigned long)'
  'int __traceiter_android_rvh_do_sea(void*, unsigned long, unsigned long, struct pt_regs*)'
  'int __traceiter_android_rvh_do_sp_pc_abort(void*, unsigned long, unsigned long, struct pt_regs*)'
  'int __traceiter_android_rvh_do_undefinstr(void*, struct pt_regs*, unsigned long)'
  'int __traceiter_android_rvh_panic_unhandled(void*, struct pt_regs*, const char*, unsigned long)'
  'int __traceiter_android_rvh_report_bug(void*, const char*, unsigned int, unsigned long)'
  'int __traceiter_android_vh_try_to_freeze_todo(void*, unsigned int, unsigned int, bool)'
  'int __traceiter_android_vh_try_to_freeze_todo_unfrozen(void*, struct task_struct*)'
  'int __traceiter_android_vh_watchdog_timer_softlockup(void*, int, struct pt_regs*, bool)'

12 variable symbol(s) added
  'struct tracepoint __tracepoint_android_rvh_arm64_serror_panic'
  'struct tracepoint __tracepoint_android_rvh_die_kernel_fault'
  'struct tracepoint __tracepoint_android_rvh_do_el1_bti'
  'struct tracepoint __tracepoint_android_rvh_do_el1_fpac'
  'struct tracepoint __tracepoint_android_rvh_do_sea'
  'struct tracepoint __tracepoint_android_rvh_do_sp_pc_abort'
  'struct tracepoint __tracepoint_android_rvh_do_undefinstr'
  'struct tracepoint __tracepoint_android_rvh_panic_unhandled'
  'struct tracepoint __tracepoint_android_rvh_report_bug'
  'struct tracepoint __tracepoint_android_vh_try_to_freeze_todo'
  'struct tracepoint __tracepoint_android_vh_try_to_freeze_todo_unfrozen'
  'struct tracepoint __tracepoint_android_vh_watchdog_timer_softlockup'

Bug: 273189923
Change-Id: I47e18fd50b182370bc663239dc49d10ea5293a52
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
2023-03-13 20:34:25 +00:00
Sangmoon Kim
bb8c223f2f ANDROID: arm64: add vendor hooks for unusal abort cases
Add hooks to gather data of unsual aborts and summarize it with
other information.

Bug: 273189923

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I74eb36b8551ed9a5e6dc87507939a7f4d81c9c18
(cherry picked from commit 102255d1e4)
2023-03-13 20:34:25 +00:00
Sangmoon Kim
2d9a325f0c ANDROID: arm64: add vendor hooks for kernel fault cases
Add hooks to gather data of kernel fault and summarize it with
other information.

Bug: 273189923

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I7d6a66837f2e896a413bd8d878f26928669d96e6
(cherry picked from commit 61d7b6c741)
2023-03-13 20:34:25 +00:00
Sangmoon Kim
c5ea4db533 ANDROID: power: add vendor hooks for try_to_freeze fail
Add hooks to gather data of unfrozen tasks and summarize it
with other information.

Bug: 273189923

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I61da3d253bd9959c6f06e09c9a35c4b242cedafe
(cherry picked from commit 2232e3fc85)
2023-03-13 20:34:25 +00:00
Sangmoon Kim
8635a09118 ANDROID: softlockup: add vendor hook for a softlockup task
Add hook to gather data of softlockup and summarize it with
other information.

Bug: 273189923

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I5263bbd573c3fa4b4c981ac26c943721ce09506d
(cherry picked from commit 5cc613a916)
2023-03-13 20:34:25 +00:00
Sangmoon Kim
e74b4da791 ANDROID: bug: add vendor hook for bug trap
Add hook to gather data of bug trap and summarize it with other
information.

Bug: 273189923

Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I1f347c20629786f9bf0b9c50c7f96b50b4360504
(cherry picked from commit ba7e9d1a77)
2023-03-13 20:34:25 +00:00
Greg Kroah-Hartman
7b2b54bf2b Merge 6.1.17 into android14-6.1
Changes in 6.1.17
	Revert "blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()"
	Revert "blk-cgroup: dropping parent refcount after pd_free_fn() is done"
	Linux 6.1.17

Change-Id: I95ce33fb17bcd36d65dff2680d0a09d646e7292f
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-13 18:57:25 +00:00
Greg Kroah-Hartman
0c2020b732 ANDROID: update abi definition due to io_uring changes.
Commit f09fb7ff2a ("io_uring: Replace 0-length array with flexible
array") changed the struct io_uring_buf_ring to be safer when being
compiled by userspace code (it is in a uapi header file.)  In order to
do this properly, an "empty" structure was added to the structure so
that tools continue to work properly.  This updates the abi definitions
with those changes, as the tools rightfully catch that the signature
changed, yet there is no actualy functional or ABI change noticable by
any code.

function symbol 'bool hid_ignore(struct hid_device*)' changed
  CRC changed from 0x6472f954 to 0x60a463f6

type 'struct io_uring_buf_ring' changed
  member changed from 'union { struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; struct io_uring_buf bufs[0]; }' to 'union { struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; struct { struct { } __empty_bufs; struct io_uring_buf bufs[0]; }; }'
    type changed from 'union { struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; struct io_uring_buf bufs[0]; }' to 'union { struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; struct { struct { } __empty_bufs; struct io_uring_buf bufs[0]; }; }'
      member 'struct { struct { } __empty_bufs; struct io_uring_buf bufs[0]; }' was added
      member 'struct io_uring_buf bufs[0]' was removed

Fixes: f09fb7ff2a ("io_uring: Replace 0-length array with flexible array")
Change-Id: I03723a9f86bd12ac738625e11b3f54ff9f3026f0
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-13 18:54:04 +00:00
Greg Kroah-Hartman
9e15dec26c UPSTREAM: Revert "blk-cgroup: dropping parent refcount after pd_free_fn() is done"
This reverts commit 029f1f1efa which is
commit c7241babf0 upstream.

It is reported to cause problems, as only 2 of the 3 patch series were
applied to the stable branches.

Reported-by: Mike Cloaked <mike.cloaked@gmail.com>
Reported-by: Eric Biggers <ebiggers@kernel.org>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Sasha Levin <sashal@kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217174
Link: https://lore.kernel.org/r/ZAuPkCn49urWBN5P@sol.localdomain
Change-Id: I4b1cf7f1e7643fa01e7edeccf1fa84e337ce8d0f
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit deef2947d5)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-13 18:54:04 +00:00
Greg Kroah-Hartman
5af366e3e7 UPSTREAM: Revert "blk-cgroup: synchronize pd_free_fn() from blkg_free_workfn() and blkcg_deactivate_policy()"
This reverts commit 81c1188905 which is
commit f1c006f1c6 upstream.

It is reported to cause problems, as only 2 of the 3 patch series were
applied to the stable branches.

Reported-by: Mike Cloaked <mike.cloaked@gmail.com>
Reported-by: Eric Biggers <ebiggers@kernel.org>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Sasha Levin <sashal@kernel.org>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217174
Link: https://lore.kernel.org/r/ZAuPkCn49urWBN5P@sol.localdomain
Change-Id: I6e17c9b3a1a88216b08cae18b050b749666cad1d
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit b5dae1cd0d)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2023-03-13 18:53:52 +00:00