> Hi,
> > if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION &&
> > (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) {
> > - dev_info->hpb_enabled = true;
> > + bool hpb_en = false;
> > +
> > ufshpb_get_dev_info(hba, desc_buf);
> > +
The cache function can be turned ON and OFF by writing to the CACHE_CTRL
byte (EXT_CSD byte [33]). However, card->ext_csd.cache_ctrl is only
set on init if cache size > 0.
Fix that by explicitly setting ext_csd.cache_ctrl on ext-csd write.
Signed-off-by: Avri Altman
Acked-by: Adrian
so.
fixes: 1e8e55b67030 (mmc: block: Add CQE support)
Reported-by: Brendan Peter
Tested-by: Brendan Peter
Signed-off-by: Avri Altman
---
drivers/mmc/core/block.c | 9 +
drivers/mmc/core/mmc.c | 2 +-
drivers/mmc/core/mmc_ops.h | 5 +
3 files changed, 15 insertions(+), 1
red
to an access to the main nonvolatile storage.
The cache function can be turned ON and OFF. Once OFF, the host is not
expected to issue a flush-cache command to the device.
Avri Altman (2):
mmc: block: Issue flush only if allowed
mmc: block: Update ext_csd.cache_ctrl if it was written
> On 20/04/21 8:53 am, Avri Altman wrote:
> > The cache may be flushed to the nonvolatile storage by writing to
> > FLUSH_CACHE byte (EXT_CSD byte [32]). When in command queueing mode,
> the
> > cache may be flushed by issuing a CMDQ_TASK_ DEV_MGMT (CMD48) with a
> >
The cache function can be turned ON and OFF by writing to the CACHE_CTRL
byte (EXT_CSD byte [33]). However, card->ext_csd.cache_ctrl is only
set on init if cache size > 0.
Fix that by explicitly setting ext_csd.cache_ctrl on ext-csd write.
Signed-off-by: Avri Altman
---
drivers/mm
so.
fixes: 1e8e55b67030 (mmc: block: Add CQE support)
Reported-by: Brendan Peter
Tested-by: Brendan Peter
Signed-off-by: Avri Altman
---
drivers/mmc/core/block.c | 7 +++
drivers/mmc/core/mmc.c | 2 +-
drivers/mmc/core/mmc_ops.h | 5 +
3 files changed, 13 insertions(+), 1
tion can be turned ON and OFF. Once OFF, the host is not
expected to issue a flush-cache command to the device.
Avri Altman (2):
mmc: block: Issue flush only if allowed
mmc: block: Update ext_csd.cache_ctrl if it was written
drivers/mmc/core/block.c | 19 +++
drivers/mmc
>
> On Sun, 18 Apr 2021 at 08:00, Avri Altman wrote:
> >
> > The cache may be flushed to the nonvolatile storage by writing to
> > FLUSH_CACHE byte (EXT_CSD byte [32]). When in command queueing mode,
> the
> > cache may be flushed by issuing a CMDQ_TASK_ DEV_MG
>
> On Sun, 18 Apr 2021 at 08:00, Avri Altman wrote:
> >
> > The cache may be flushed to the nonvolatile storage by writing to
> > FLUSH_CACHE byte (EXT_CSD byte [32]). When in command queueing mode,
> the
> > cache may be flushed by issuing a CMDQ_TASK_ DEV_MG
how.
>
> Signed-off-by: Ulf Hansson
Reviewed-by: Avri Altman
Hi,
> if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION &&
> (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) {
> - dev_info->hpb_enabled = true;
> + bool hpb_en = false;
> +
> ufshpb_get_dev_info(hba, desc_buf);
> +
> +
> On 18/04/21 10:21 am, Avri Altman wrote:
> > The UFS driver allowed BKOPS and WB Flush operations to be completed on
> > Runtime suspend. Adding the DeepSleep support, this is no longer true:
> > the driver will ignore BKOPS and WB Flush states, and force a link st
suspend flow.
fixes: fe1d4c2ebcae (scsi: ufs: Add DeepSleep feature)
Suggested-by: Alex Lemberg
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshcd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 58d7f264c664
The cache function can be turned ON and OFF by writing to the CACHE_CTRL
byte (EXT_CSD byte [33]). However, card->ext_csd.cache_ctrl is only
set on init if cache size > 0.
Fix that by explicitly setting ext_csd.cache_ctrl on ext-csd write.
Signed-off-by: Avri Altman
---
drivers/mm
so.
fixes: 1e8e55b67030 (mmc: block: Add CQE support)
Reported-by: Brendan Peter
Tested-by: Brendan Peter
Signed-off-by: Avri Altman
---
drivers/mmc/core/block.c | 7 +++
drivers/mmc/core/mmc_ops.c | 4 +---
drivers/mmc/core/mmc_ops.h | 5 +
3 files changed, 13 insertions(+), 3
t is not
expected to issue a flush-cache command to the device.
Avri Altman (2):
mmc: block: Issue flush only if allowed
mmc: block: Update ext_csd.cache_ctrl if it was written
drivers/mmc/core/block.c | 19 +++
drivers/mmc/core/mmc_ops.c | 4 +---
drivers/mmc/core/mmc_op
> From: Daejun Park
>
> @@ -1692,6 +2188,7 @@ static void ufshpb_hpb_lu_prepared(struct ufs_hba
> *hba)
> ufshpb_set_state(hpb, HPB_PRESENT);
> if ((hpb->lu_pinned_end - hpb->lu_pinned_start) > 0)
> queue_work(ufshpb_
Scott hi,
Can you take a look at
https://lore.kernel.org/lkml/20210322133645.4901-1-avri.alt...@wdc.com/
Is there a chance that it will work for you as well?
Thanks,
Avri
> -Original Message-
> From: Scott Branden
> Sent: Tuesday, 13 April 2021 18:46
> To: Ulf Hansson ; Bean Huo (beanhu
In host control mode the host is the originator of map requests. To not
flood the device with map requests, use a simple throttling mechanism
that limits the number of inflight map requests.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c | 11
to-be-inactivated" list, unless it is clean and did
not exhaust its READ_TO_EXPIRIES - another parameter.
All this does not apply to pinned regions.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c | 74 +--
driver
We can make use of this commit, to elaborate some more of the host
control mode logic, explaining what role play each and every variable.
While at it, allow those parameters to be configurable.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
Documentation/ABI/testing/sysfs-driver-ufs
reads as a
comparative score, to make various decisions.
If during consecutive normalizations an active region has exhaust its
reads - inactivate it.
while at it, protect the {active,inactive}_count stats by adding them
into the applicable handler.
Signed-off-by: Avri Altman
Reviewed-by: D
Support devices that report they are using host control mode.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index 0f72ea3f5d71..3c4001486cf1 100644
The spec does not define what is the host's recommended response when
the device send hpb dev reset response (oper 0x2).
We will update all active hpb regions: mark them and do that on the next
read.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c
on to
update an active and clean subregion, it is better to follow those
recommendation because otherwise the host has no other way to know that
some internal relocation took place.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c
In host mode, the host is expected to send HPB-WRITE-BUFFER with
buffer-id = 0x1 when it inactivates a region.
Use the map-requests pool as there is no point in assigning a
designated cache for umap-requests.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c
Given a transfer length, set_dirty meticulously runs over all the
entries, across subregions and regions if needed. Currently its only use
is to mark dirty blocks, but soon HCM may profit from it as well, when
managing its read counters.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
In host mode, eviction is considered an extreme measure.
verify that the entering region has enough reads, and the exiting
region has much less reads.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshpb.c | 18 +-
1 file changed, 17 insertions(+), 1
sparent and
readable, while allow tuning / scaling its various parameters, and
utilize system-wide info to optimize HPB potential.
This series is based on Samsung's V32 device-control HPB2.0 driver
This version was tested on Galaxy S20, and Xiaomi Mi10 pro.
Your meticulous review and testing is
We will use it later, when we'll need to differentiate between device
and host control modes.
Signed-off-by: Avri Altman
Reviewed-by: Daejun Park
---
drivers/scsi/ufs/ufshcd.h | 2 ++
drivers/scsi/ufs/ufshpb.c | 8 +---
drivers/scsi/ufs/ufshpb.h | 2 ++
3 files changed, 9 insertions(
> > >> On 2021-04-06 13:20, Avri Altman wrote:
> > >> >> > -static void __ufshpb_evict_region(struct ufshpb_lu *hpb,
> > >> >> > - struct ufshpb_region *rgn)
> > >
> >>
> >> On 2021-04-06 13:20, Avri Altman wrote:
> >> >> > -static void __ufshpb_evict_region(struct ufshpb_lu *hpb,
> >> >> > - struct ufshpb_region *rgn)
> >&g
>
> On 2021-04-06 13:20, Avri Altman wrote:
> >> > -static void __ufshpb_evict_region(struct ufshpb_lu *hpb,
> >> > - struct ufshpb_region *rgn)
> >> > +static int __ufshpb_evict_region(struct ufshpb_lu *hpb,
&g
> > -static void __ufshpb_evict_region(struct ufshpb_lu *hpb,
> > - struct ufshpb_region *rgn)
> > +static int __ufshpb_evict_region(struct ufshpb_lu *hpb,
> > + struct ufshpb_region *rgn)
> > {
> > struct victim_select_info *lru_inf
same problem
> is present when memcpy() overruns the length of the source
> &treq.rsp_header; in this case the address of the new struct
> object _upiu_rsp_ is used, instead.
>
> Also, this helps with the ongoing efforts to enable -Warray-bounds
> and avoid confusing the com
>> @@ -571,6 +571,14 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card,
>> struct mmc_blk_data *md,
>> main_md->part_curr = value & EXT_CSD_PART_CONFIG_ACC_MASK;
>> }
>>
>> +/* Make sure to update CACHE_CTRL in case it was changed */
> It might be worth noting that t
>> @@ -1473,6 +1473,9 @@ static int mmc_blk_cqe_issue_flush(struct mmc_queue
>> *mq, struct request *req)
>> struct mmc_queue_req *mqrq = req_to_mmc_queue_req(req);
>> struct mmc_request *mrq = mmc_blk_cqe_prep_dcmd(mqrq, req);
>>
>> +if (mmc_card_mmc(mq->card) && !mmc_flush_allowe
> ufshcd_tmc_handler() calls blk_mq_tagset_busy_iter(fn =
> ufshcd_compl_tm()),
> but since blk_mq_tagset_busy_iter() only iterates over all reserved tags
> and requests which are not in IDLE state, ufshcd_compl_tm() never gets a
> chance to run. Thus, TMR always ends up with completion timeout. Fi
We can make use of this commit, to elaborate some more of the host
control mode logic, explaining what role play each and every variable.
While at it, allow those parameters to be configurable.
Signed-off-by: Avri Altman
---
Documentation/ABI/testing/sysfs-driver-ufs | 84 +-
drivers/scsi
Support devices that report they are using host control mode.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index c07da481ff4e..08066bb6da65 100644
--- a/drivers/scsi/ufs
In host control mode the host is the originator of map requests. To not
flood the device with map requests, use a simple throttling mechanism
that limits the number of inflight map requests.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 11 +++
drivers/scsi/ufs/ufshpb.h
In host mode, eviction is considered an extreme measure.
verify that the entering region has enough reads, and the exiting
region has much less reads.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a
to-be-inactivated" list, unless it is clean and did
not exhaust its READ_TO_EXPIRIES - another parameter.
All this does not apply to pinned regions.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 74 +--
drivers/scsi/ufs/ufshpb.h | 8
The spec does not define what is the host's recommended response when
the device send hpb dev reset response (oper 0x2).
We will update all active hpb regions: mark them and do that on the next
read.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c
In host mode, the host is expected to send HPB-WRITE-BUFFER with
buffer-id = 0x1 when it inactivates a region.
Use the map-requests pool as there is no point in assigning a
designated cache for umap-requests.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 35
Given a transfer length, set_dirty meticulously runs over all the
entries, across subregions and regions if needed. Currently its only use
is to mark dirty blocks, but soon HCM may profit from it as well, when
managing its read counters.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c
reads as a
comparative score, to make various decisions.
If during consecutive normalizations an active region has exhaust its
reads - inactivate it.
while at it, protect the {active,inactive}_count stats by adding them
into the applicable handler.
Signed-off-by: Avri Altman
---
drivers/scsi/uf
on to
update an active and clean subregion, it is better to follow those
recommendation because otherwise the host has no other way to know that
some internal relocation took place.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 34 +-
drivers/scs
We will use it later, when we'll need to differentiate between device
and host control modes.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshcd.h | 2 ++
drivers/scsi/ufs/ufshpb.c | 8 +---
drivers/scsi/ufs/ufshpb.h | 2 ++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --
ze HPB potential.
This series is based on Samsung's V32 device-control HPB2.0 driver
This version was tested on Galaxy S20, and Xiaomi Mi10 pro.
Your meticulous review and testing is mostly welcome and appreciated.
Thanks,
Avri
Avri Altman (11):
scsi: ufshpb: Cache HPB Control mo
>
> The header file is already included above and can be
> removed here.
Already removed, see
https://lore.kernel.org/lkml/20210306114706.217873-1-zhang.yun...@zte.com.cn/
Thanks,
Avri
>
> Signed-off-by: Zhen Lei
> ---
> drivers/scsi/ufs/ufshcd.c | 1 -
> 1 file changed, 1 deletion(-)
>
> d
> > > @@ -596,12 +615,43 @@ int ufshpb_prep(struct ufs_hba *hba, struct
> > > ufshcd_lrb *lrbp)
> > > ufshpb_set_ppn_dirty(hpb, rgn_idx, srgn_idx, srgn_offset,
> > >transfer_len);
> > > spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
>
> On 2021-03-22 16:10, Avri Altman wrote:
> > In host mode, eviction is considered an extreme measure.
> > verify that the entering region has enough reads, and the exiting
> > region has much less reads.
> >
> > Signed-off-by: Avri Altman
> &g
> >> @@ -1245,6 +1257,18 @@ static void
> ufshpb_rsp_req_region_update(struct
> >> ufshpb_lu *hpb,
> >> srgn_i =
> >>
> >> be16_to_cpu(rsp_field->hpb_active_field[i].active_srgn);
> >>
> >> +rgn = hpb->rgn_tbl + rgn_i;
> >> +if (hpb->is_hcm
> > @@ -596,12 +615,43 @@ int ufshpb_prep(struct ufs_hba *hba, struct
> > ufshcd_lrb *lrbp)
> > ufshpb_set_ppn_dirty(hpb, rgn_idx, srgn_idx, srgn_offset,
> >transfer_len);
> > spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > +
> >
>
> On 2021-03-23 14:37, Daejun Park wrote:
> >> On 2021-03-23 14:19, Daejun Park wrote:
> On 2021-03-23 13:37, Daejun Park wrote:
> >> On 2021-03-23 12:22, Can Guo wrote:
> >>> On 2021-03-22 17:11, Bean Huo wrote:
> On Mon, 2021-03-22 at 15:54 +0900, Daejun Park wrote:
> >>>
The cache function can be turned ON and OFF by writing to the CACHE_CTRL
byte (EXT_CSD byte [33]). However, card->ext_csd.cache_ctrl is only
set on init if cache size > 0.
Fix that by explicitly setting ext_csd.cache_ctrl on ext-csd write.
Signed-off-by: Avri Altman
---
drivers/mm
so.
fixes: 1e8e55b67030 (mmc: block: Add CQE support)
Reported-by: Brendan Peter
Tested-by: Brendan Peter
Signed-off-by: Avri Altman
---
drivers/mmc/core/block.c | 3 +++
drivers/mmc/core/mmc_ops.c | 4 +---
drivers/mmc/core/mmc_ops.h | 5 +
3 files changed, 9 insertions(+), 3 deletions
to the device.
Avri Altman (2):
mmc: block: Issue flush only if allowed
mmc: block: Update ext_csd.cache_ctrl if it was written
drivers/mmc/core/block.c | 11 +++
drivers/mmc/core/mmc_ops.c | 4 +---
drivers/mmc/core/mmc_ops.h | 5 +
3 files changed, 17 insertions(+), 3
We can make use of this commit, to elaborate some more of the host
control mode logic, explaining what role play each and every variable.
While at it, allow those parameters to be configurable.
Signed-off-by: Avri Altman
---
Documentation/ABI/testing/sysfs-driver-ufs | 84 +-
drivers/scsi
In host control mode the host is the originator of map requests. To not
flood the device with map requests, use a simple throttling mechanism
that limits the number of inflight map requests.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 11 +++
drivers/scsi/ufs/ufshpb.h
Support devices that report they are using host control mode.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 6 --
1 file changed, 6 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index f755f5a7775c..51c527c6f8c2 100644
--- a/drivers/scsi/ufs
The spec does not define what is the host's recommended response when
the device send hpb dev reset response (oper 0x2).
We will update all active hpb regions: mark them and do that on the next
read.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c
to-be-inactivated" list, unless it is clean and did
not exhaust its READ_TO_EXPIRIES - another parameter.
All this does not apply to pinned regions.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 74 +--
drivers/scsi/ufs/ufshpb.h | 8
In host mode, eviction is considered an extreme measure.
verify that the entering region has enough reads, and the exiting
region has much less reads.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 18 +-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a
In host mode, the host is expected to send HPB-WRITE-BUFFER with
buffer-id = 0x1 when it inactivates a region.
Use the map-requests pool as there is no point in assigning a
designated cache for umap-requests.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 35
reads as a
comparative score, to make various decisions.
If during consecutive normalizations an active region has exhaust its
reads - inactivate it.
while at it, protect the {active,inactive}_count stats by adding them
into the applicable handler.
Signed-off-by: Avri Altman
---
drivers/scsi/uf
on to
update an active and clean subregion, it is better to follow those
recommendation because otherwise the host has no other way to know that
some internal relocation took place.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 34 +-
drivers/scs
We will use it later, when we'll need to differentiate between device
and host control modes.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshcd.h | 2 ++
drivers/scsi/ufs/ufshpb.c | 8 +---
drivers/scsi/ufs/ufshpb.h | 2 ++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --
eed5f81eaa4f2a8340aaedb446c@epcms2p6
in lore.kernel.org.
This version was tested on Galaxy S20, and Xiaomi Mi10 pro.
Your meticulous review and testing is mostly welcome and appreciated.
Thanks,
Avri
Avri Altman (10):
scsi: ufshpb: Cache HPB Control mode on init
scsi: ufshpb: Add host contr
> +static int ufshpb_execute_umap_req(struct ufshpb_lu *hpb,
> + struct ufshpb_req *umap_req,
> + struct ufshpb_region *rgn)
> +{
> + struct request *req;
> + struct scsi_request *rq;
> +
> + req = umap_req->req;
>
>
> -int ufshcd_wb_ctrl(struct ufs_hba *hba, bool enable)
> +static int __ufshcd_wb_toggle(struct ufs_hba *hba, bool set, enum flag_idn
> idn)
> {
> - int ret;
> u8 index;
> enum query_opcode opcode;
What I meant is:
enum query_opcode opcode = set ? UPIU_QUERY_OPCO
> On 2021-03-17 23:46, Avri Altman wrote:
> >> >> >> >>
> >> >> >> >> Just curious, directly doing below things inside ufshpb_rsp_upiu()
> >> >> >> >> does
> >> >> >> >> not
> &
> >> >> >>
> >> >> >> Just curious, directly doing below things inside ufshpb_rsp_upiu()
> >> >> >> does
> >> >> >> not
> >> >> >> seem a problem to me, does this really deserve a separate work?
> >> >> > I don't know, I never even consider of doing this.
> >> >> > The active region list may contai
>
> On 2021-03-17 20:22, Avri Altman wrote:
> >>
> >> On 2021-03-17 19:23, Avri Altman wrote:
> >> >>
> >> >> On 2021-03-02 21:24, Avri Altman wrote:
> >> >> > The spec does not define what is the host's recommend
Signed-off-by: Yue Hu
A small nit below, otherwise - looks good to me.
Reviewed-by: Avri Altman
> ---
> drivers/scsi/ufs/ufs-sysfs.c | 2 +-
> drivers/scsi/ufs/ufshcd.c| 99
> +++-
> drivers/scsi/ufs/ufshcd.h| 2 +-
> 3 files chan
>
> On 2021-03-17 19:23, Avri Altman wrote:
> >>
> >> On 2021-03-02 21:24, Avri Altman wrote:
> >> > The spec does not define what is the host's recommended response when
> >> > the device send hpb dev reset response (oper 0x2).
> >>
>
> On 2021-03-02 21:24, Avri Altman wrote:
> > The spec does not define what is the host's recommended response when
> > the device send hpb dev reset response (oper 0x2).
> >
> > We will update all active hpb regions: mark them and do that on the
> > n
> >> > @@ -1079,6 +1113,14 @@ static void __ufshpb_evict_region(struct
> >> > ufshpb_lu *hpb,
> >> >
> >> > ufshpb_cleanup_lru_info(lru_info, rgn);
> >> >
> >> > + if (hpb->is_hcm) {
> >> > + unsigned long flags;
> >> > +
> >> > + spin_lock_irqsave(&rgn->rgn_lock,
> On 2021-03-17 10:28, Daejun Park wrote:
> >>> >> ---
> >>> >> drivers/scsi/ufs/ufshpb.c | 14 ++
> >>> >> drivers/scsi/ufs/ufshpb.h | 1 +
> >>> >> 2 files changed, 15 insertions(+)
> >>> >>
> >>> >> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
> >>> >> index 6
> On 2021-03-16 17:21, Avri Altman wrote:
> >> > +static void ufshpb_read_to_handler(struct work_struct *work)
> >> > +{
> >> > + struct delayed_work *dwork = to_delayed_work(work);
> >> > + struct ufshpb_lu *hpb;
> >> >
> > +static void ufshpb_read_to_handler(struct work_struct *work)
> > +{
> > + struct delayed_work *dwork = to_delayed_work(work);
> > + struct ufshpb_lu *hpb;
> > + struct victim_select_info *lru_info;
> > + struct ufshpb_region *rgn;
> > + unsigned long flags;
> > + LIST_H
> > int ret = 0;
> > @@ -1263,6 +1271,16 @@ static int ufshpb_add_region(struct ufshpb_lu
> > *hpb, struct ufshpb_region *rgn)
> >* because the device could detect this region
> >* by not issuing HPB_READ
> >*/
> > +
> >
>
>
> On 2021-03-02 21:25, Avri Altman wrote:
> > in host control mode the host is the originator of map requests. To not
>
> in -> In
Done.
>
> Thanks,
> Can Guo.
>
> > flood the device with map requests, use a simple throttling mechanism
> >
> >> ---
> >> drivers/scsi/ufs/ufshpb.c | 14 ++
> >> drivers/scsi/ufs/ufshpb.h | 1 +
> >> 2 files changed, 15 insertions(+)
> >>
> >> diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
> >> index 6f4fd22eaf2f..0744feb4d484 100644
> >> --- a/drivers/scsi/ufs/ufshpb.c
> > + /* if region is active but has no reads - inactivate it */
> > + spin_lock(&hpb->rsp_list_lock);
> > + ufshpb_update_inactive_info(hpb, rgn->rgn_idx);
>
> Miss a hpb->stats.rb_inactive_cnt++ here?
Thanks.
Also noticed that since rb_inactive_cnt and rb_acti
> > +
> > + if (hpb->is_hcm) {
> > + spin_lock_irqsave(&rgn->rgn_lock, flags);
>
> rgn_lock is never used in IRQ contexts, so no need of irqsave and
> irqrestore everywhere, which can impact performance. Please correct
> me if I am wrong.
Thanks. Will do.
>
> Mea
> >
> > +static void ufshpb_read_to_handler(struct work_struct *work)
> > +{
> > + struct delayed_work *dwork = to_delayed_work(work);
> > + struct ufshpb_lu *hpb;
>
> struct ufshpb_lu *hpb = container_of(work, struct ufshpb_lu,
> ufshpb_read_to_work.work);
>
> usually we use thi
> > +static void ufshpb_reset_work_handler(struct work_struct *work)
> > +{
> > + struct ufshpb_lu *hpb;
>
> struct ufshpb_lu *hpb = container_of(work, struct ufshpb_lu,
> ufshpb_lun_reset_work);
>
> > + struct victim_select_info *lru_info;
>
> struct victim_select_info
> Avri Altman writes:
>
> > The mmc driver has some hooks to support rpmb access, but access is
> > mainly facilitated from user space, e.g. mmc-utils.
> >
> > The ufs driver has no concept of rpmb access - it is facilitated via
> > user space, e.g. ufs-uti
>
> On 2021-03-02 21:24, Avri Altman wrote:
> > I host mode, the host is expected to send HPB-WRITE-BUFFER with
>
> In host mode,
Done.
> > static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
> > {
> > return ufshpb_issue_umap_req(hpb, NULL
> > diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
> > index a8f8d13af21a..6f4fd22eaf2f 100644
> > --- a/drivers/scsi/ufs/ufshpb.c
> > +++ b/drivers/scsi/ufs/ufshpb.c
> > @@ -17,6 +17,7 @@
> > #include "../sd.h"
> >
> > #define ACTIVATION_THRESHOLD 4 /* 4 IOs */
> > +#define E
> > diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
> > index 044fec9854a0..a8f8d13af21a 100644
> > --- a/drivers/scsi/ufs/ufshpb.c
> > +++ b/drivers/scsi/ufs/ufshpb.c
> > @@ -16,6 +16,8 @@
> > #include "ufshpb.h"
> > #include "../sd.h"
> >
> > +#define ACTIVATION_THRESHOLD 4 /
> Hi Avri,
>
> On 10/03/2021 4:34 pm, Avri Altman wrote:
> >> @@ -9298,10 +9291,7 @@ int ufshcd_init(struct ufs_hba *hba, void
> __iomem
> >> *mmio_base, unsigned int irq)
> >> /* Get UFS version supported by the controller */
> >>
> @@ -9298,10 +9291,7 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem
> *mmio_base, unsigned int irq)
> /* Get UFS version supported by the controller */
> hba->ufs_version = ufshcd_get_ufs_version(hba);
>
> - if ((hba->ufs_version != UFSHCI_VERSION_10) &&
> -
The mmc driver has some hooks to support rpmb access, but access is
mainly facilitated from user space, e.g. mmc-utils.
The ufs driver has no concept of rpmb access - it is facilitated via
user space, e.g. ufs-utils and similar.
Both for ufs and mmc, rpmb access is defined in their applicable jed
>
> When np is NULL or of_parse_phandle() returns NULL, no error return code
> of ufshcd_populate_vreg() is assigned.
> To fix this bug, ret is assigned with -EINVAL or -ENOENT as error return
> code.
This changes the flow of ufshcd_parse_regulator_info so you need to:
a) get a tested-by tag and i
since it may be
> called multiple times during error recovery.
>
> Signed-off-by: Can Guo
Reviewed-by: Avri Altman
> ---
> drivers/scsi/ufs/ufshcd.c | 18 --
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/dr
>
>
> 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
1 - 100 of 509 matches
Mail list logo