>
> Signed-off-by: Tomas Winkler
> Signed-off-by: Alexander Usyskin
Tested-by: Avri Altman
- mmc - full functionality. One issue found that was fixed on V6: patch V6 2/9.
- ufs - read & read counter only. Testing is still wip.
> +static int rpmb_request_verify(struc
Hi,
Can you elaborate how this can even happen?
Isn't the interrupt aggregation capability should attend for those cases?
Thanks,
Avri
> -Original Message-
> From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi-
> ow...@vger.kernel.org] On Behalf Of Asutosh Das
> Sent: Tuesday, Janua
> -Original Message-
> From: Andy Shevchenko [mailto:andriy.shevche...@linux.intel.com]
> Sent: Monday, March 12, 2018 12:08 PM
> To: Harish Jenny K N ; ulf.hans...@linaro.org;
> linus.wall...@linaro.org; adrian.hun...@intel.com; shawn.lin@rock-
> chips.com; Avri A
> -Original Message-
> From: Harish Jenny K N [mailto:harish_kand...@mentor.com]
> Sent: Monday, March 12, 2018 1:17 PM
> To: Avri Altman ; Andy Shevchenko
> ; ulf.hans...@linaro.org;
> linus.wall...@linaro.org; adrian.hun...@intel.com; shawn@rock-chi
> -Original Message-
> From: Harish Jenny K N [mailto:harish_kand...@mentor.com]
> Sent: Wednesday, March 07, 2018 7:38 AM
> To: ulf.hans...@linaro.org; linus.wall...@linaro.org;
> adrian.hun...@intel.com; shawn@rock-chips.com; Avri Altman
> ; andriy.shevche...@li
; > ---
> > block/bsg.c | 158
> > 1 file changed, 72 insertions(+), 86 deletions(-)
> >
>
> Looks fine to me. Did ran the same small test-tool I ran against Jens'
> patches, nothing broke.
>
> Reviewed-by: Benjamin Block
> Tested-by: Benjamin Block
Test
owing for the eventual
> removal of the latter.
>
> Signed-off-by: Christoph Hellwig
Tested-by: Avri Altman
Regardless of the ongoing discussion with Benjamin -
Tested the scsi pass-through (ufs-bsg) path - nothing is broken.
Hello Tomas,
>
> Define new a type: uc_string_id for easier string
> handling and less casting. Reduce number or string
> copies in price of a dynamic allocation.
>
> Signed-off-by: Tomas Winkler
Tested-by: Avri Altman
Just one nit - doesn't really matters.
Cheers,
Looks fine.
Thanks,
Avri
> eMMC 5.0 introduced OPTIMAL_READ_SIZE, OPTIMAL_WRITE_SIZE and
> OPTIMAL
> TRIM_UNIT_SIZE fields in the extcsd
>
> Interpret these fields when reading out the extcsd with human-readable
> results
>
> Signed-off-by: James Nuss
Reviewed-by: Avri Altman
> +++ b/mmc_cmds.c
> @@ -1758,8 +1758,15 @@ int do_read_extcsd(int nargs, char **argv)
> }
>
> if (ext_csd_rev >= 7) {
> - printf("eMMC Firmware Version: %s\n",
> - (char*)&ext_csd[EXT_CSD_FIRMWARE_VERSION]);
> + printf("Firmware Version:
>
>
> On Wed, Oct 10, 2018 at 4:43 AM Avri Altman wrote:
> >
> >
> > > +++ b/mmc_cmds.c
> > > @@ -1758,8 +1758,15 @@ int do_read_extcsd(int nargs, char **argv)
> > > }
> > >
> > > if (ext_csd_rev
> 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
> >
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
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
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
> 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 same.
>
> Signed-off-by: Seungwon Jeon
> Signed-off-by: Alim Akhtar
Acked-by: Avri Altman
Might be also useful exporting an API for all uic commands?
Thanks,
Avri
bus width.
>
> verified it didn't mount.
>
> Signed-off-by: Raul E Rangel
Acked-by: Avri Altman
> ---
> AMD SDHC Device 7806 can get into a bad state after a card disconnect
> where anything transferred via the DATA lines will always result in a
> zero filled buffer.
>
> On Mon, 15 Apr 2019 16:52:38 -0600
> Raul E Rangel wrote:
>
> > Example:
> > sd_scr: mmc0: version: 2, spec3: 1, width: 5, cmds: 0, raw: {0x2b58000,0x0}
> >
> > Signed-off-by: Raul E Rangel
> > ---
> >
> > drivers/mmc/core/sd.c | 4
> > include/trace/events/mmc.h | 42
>
he
> DATA lines. By checking that the response was invalid, we can abort
> mounting the card.
>
> Acked-by: Avri Altman
>
> Signed-off-by: Raul E Rangel
Reviewed-by: Avri Altman
Thanks,
Avri
Martin,
Any further comments?
Thanks,
Avri
> -Original Message-
> From: Evan Green
> Sent: Monday, January 28, 2019 8:42 PM
> To: Avri Altman
> Cc: James E.J. Bottomley ; Martin K. Petersen
> ; SCSI ; LKML
> ; Avi Shchislowski ;
> Alex Lemberg
> Subject: R
> On Sun, 3 Feb 2019 at 09:51, Avri Altman wrote:
> >
> > The discard arg is a read-only ext_csd parameter -
> > set it once on card init.
>
> I like the idea here. There is really no point checking this for every
> corresponding request, nice!
>
> However,
In MMC, the discard arg is a read-only ext_csd parameter - set it once
on card init. To be consistent, do that for SD as well even though its
discard arg is always 0x0.
Signed-off-by: Avri Altman
---
drivers/mmc/core/block.c | 12 +++-
drivers/mmc/core/core.c | 4 ++--
drivers/mmc
SD specs version 4.x and 5.x have a dedicated slices in the SCR register.
Higher versions will rely on a combination of the existing fields.
Signed-off-by: Avri Altman
---
drivers/mmc/core/sd.c| 5 +
include/linux/mmc/card.h | 2 ++
2 files changed, 7 insertions(+)
diff --git a/drivers
o "erase_arg", and elaborate
the change log.
Avri Altman (3):
mmc: core: Calculate the discard arg only once
mmc: core: Indicate SD specs higher than 4.0
mmc: core: Add discard support to sd
drivers/mmc/core/block.c | 12 +++-
drivers/mmc/core/core.c | 8 ++--
d
version that introduce it.
Signed-off-by: Avri Altman
---
drivers/mmc/core/core.c | 6 +-
drivers/mmc/core/sd.c | 10 +-
include/linux/mmc/sd.h | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index de0f1a1
Hi,
> On 06/02/19 12:29 AM, Evan Green wrote:
> > Expose a reset controller that the phy will later use to control its
> > own PHY reset in the UFS controller. This will enable the combining
> > of PHY init functionality into a single function.
> >
> > Signed-off-by: Evan Green
>
> I'd like to g
bytes), is by using the job request payload
data buffer.
So change this ABI now, while ufs-bsg is still new, and nobody is
actually using it.
Signed-off-by: Avri Altman
Reviewed-by: Evan Green
---
Documentation/scsi/ufs.txt | 6 ++
drivers/scsi/ufs/ufs_bsg.c | 47
by tag.
v1->v2:
Withdraw from the attempt to change the reply buffer, instead place the
descriptor being read in the actual data buffer in the bio.
Avri Altman (3):
scsi: ufs-bsg: Change the calling convention for write descriptor
scsi: ufs: Allow reading descriptor via raw upiu
scsi
write descriptor,
and din_xferp for read descriptor.
Signed-off-by: Avri Altman
---
Documentation/scsi/ufs.txt | 7 ++-
drivers/scsi/ufs/ufs_bsg.c | 20
2 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/Documentation/scsi/ufs.txt b/Documentation/scsi/ufs.txt
Allow to read descriptors via raw upiu. This in fact was forbidden just
as a precaution, as ufs-bsg actually enforces which functionality is
supported.
Signed-off-by: Avri Altman
Reviewed-by: Evan Green
---
drivers/scsi/ufs/ufshcd.c | 20 ++--
1 file changed, 14 insertions
Ulf hi,
Thanks a lot for your comments.
>
> On Wed, 6 Feb 2019 at 12:29, Avri Altman wrote:
> >
> > SD spec v5.1 adds discard support. The flows and commands are similar to
> > mmc, so just set the discard arg in CMD38.
>
> So this means that we from now on, if th
t all in the DT.
>
> Working around that fact in the driver is detrimental, as evidenced
> by the failure to initialize the host controller on MSM8998.
>
> Revert the original patch, and clean up loose ends in the next patch.
>
> Relevant patches:
>
> 60f0187031c05e04cbadffb62f557d0ff3564490
> c58ab7aab71e2c783087115f0ce1623c2fdcf0b2
> 46c1cf706076500cdcde3445be97233793eec7f1
>
> Signed-off-by: Marc Gonzalez
Acked-by: Avri Altman
>
> The UFSHC driver defines a few quirks that are not used anywhere:
>
> UFS_DEVICE_QUIRK_BROKEN_LCC
> UFS_DEVICE_NO_VCCQ
> UFS_DEVICE_QUIRK_NO_LINK_OFF
> UFS_DEVICE_NO_FASTAUTO
>
> Let's remove them.
>
> Signed-off-by: Marc Gonzalez
Acked-by: Avri Altman
t; Update Reviewed-by tag.
>
> V2->v3:
> Add a prep patch with write descriptor calling convention changes.
> Elaborate the commit log of ufs-bsg: Allow reading descriptors
> Add Reviewed-by tag.
>
> v1->v2:
> Withdraw from the attempt to change the reply buffer,
ean some inconsistency in arg checking in mmc_erase().
Add a patch to set the timeout for sd discard.
V1->v2:
In the first patch, assign the discard arg for SD cards as well to keep
the code consistent. Rename "discard_arg" to "erase_arg", and elaborate
the change log.
Av
ntain either '0's or
'1's, depends on the content of DATA_STAT_AFTER_ERASE (b55) in the scr
register.
One more important difference compared to ERASE is the busy timeout
which we will address on the next patch.
Signed-off-by: Avri Altman
---
drivers/mmc/core/core.c | 8 --
The busy timeout is 250msec per discard command.
Signed-off-by: Avri Altman
---
drivers/mmc/core/core.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index b7367ac..4979d4e 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core
> + } else {
Is it possible to get here?
Scsi_scan_host is called only after successful add_wluns
> + /* device wlun is probed */
> + hba->luns_avail--;
> + }
> +}
> +
>
> /**
> @@ -7254,6 +7312,14 @@ static int ufshcd_scsi_add_wlus(struct ufs_hba
> *hba
> +/*
> + * This function will parse recommended active subregion information in
> sense
> + * data field of response UPIU with SAM_STAT_GOOD state.
> + */
> +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> +{
> + struct ufshpb_lu *hpb;
> + struct scsi_device *sdev;
> + if (!ufshpb_is_hpb_rsp_valid(hba, lrbp, rsp_field))
> + return;
> +
> + hpb->stats.rb_noti_cnt++;
> + switch (rsp_field->hpb_op) {
> + case HPB_RSP_NONE:
> + /* nothing to do */
> + break;
Maybe checks this too in ufshpb_is_hpb
> + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> &ppn);
> + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> + if (unlikely(err < 0)) {
> + /*
> +* In this case, the region state is active,
> +* but the pp
>
> > +/*
> > > + * This function will parse recommended active subregion information in
> > > sense
> > > + * data field of response UPIU with SAM_STAT_GOOD state.
> > > + */
> > > +void ufshpb_rsp_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> > > +{
> > > + struct ufshpb_lu *hpb;
>
>
>
> > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> &ppn);
> > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > > + if (unlikely(err < 0)) {
> > > + /*
> > > +* In this case, the region state is active,
> > > +
> > > > + err = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset, 1,
> > &ppn);
> > > > + spin_unlock_irqrestore(&hpb->rgn_state_lock, flags);
> > > > + if (unlikely(err < 0)) {
> > > > + /*
> > > > +* In this case, the region state is active,
>
> @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct Scsi_Host
> *host, struct scsi_cmnd *cmd)
>
> lrbp->req_abort_skip = false;
>
> - ufshpb_prep(hba, lrbp);
> + err = ufshpb_prep(hba, lrbp);
> + if (err == -EAGAIN) {
> + lrbp->cmd = NULL;
> +
> +static int ufshpb_fill_ppn_from_page(struct ufshpb_lu *hpb,
> +struct ufshpb_map_ctx *mctx, int pos,
> +int len, u64 *ppn_buf)
> +{
> + struct page *page;
> + int index, offset;
> + int copied;
> +
> +
> + copied = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset,
> + pre_req->wb.len - offset,
> + &addr[offset]);
> +
> + if (copied < 0)
> + goto mctx_error;
> +
> + offset += co
>
> > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct
> Scsi_Host
> > > *host, struct scsi_cmnd *cmd)
> > >
> > > lrbp->req_abort_skip = false;
> > >
> > > - ufshpb_prep(hba, lrbp);
> > > + err = ufshpb_prep(hba, lrbp);
> > > + if (err == -EAGAIN) {
> > > +
> >
> > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct
> > Scsi_Host
> > > > *host, struct scsi_cmnd *cmd)
> > > >
> > > > lrbp->req_abort_skip = false;
> > > >
> > > > - ufshpb_prep(hba, lrbp);
> > > > + err = ufshpb_prep(hba, lrbp);
> > > > + if (err ==
> 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);
> +
> + e
> +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
Maybe ufshpb_issue_umap_all_req is just a wrapper for ufshpb_issue_umap_req?
e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ?
Then on host mode inactivation:
static int ufshpb_issue_umap_single_req(struct ufshpb_lu *
>
>
> > +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
> Maybe ufshpb_issue_umap_all_req is just a wrapper for
> ufshpb_issue_umap_req?
> e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ?
> Then on host mode inactivation:
> static int ufshpb_issue_umap_single_req(s
>
> > > > > @@ -2656,7 +2656,12 @@ static int ufshcd_queuecommand(struct
> > > > Scsi_Host
> > > > > > *host, struct scsi_cmnd *cmd)
> > > > > >
> > > > > > lrbp->req_abort_skip = false;
> > > > > >
> > > > > > - ufshpb_prep(hba, lrbp);
> > > > > > + err = ufshpb_prep(hba, lrbp
> +static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx,
> + int srgn_idx, int srgn_offset, int cnt)
> +{
> + struct ufshpb_region *rgn;
> + struct ufshpb_subregion *srgn;
> + int bitmap_len = hpb->entries_per_srgn;
> + int bi
rker/2:2-173 [002] 731.486419: ufshcd_exception_event:
> :00:12.5: status 0x0
>kworker/2:2-173 [002] 732.608918: ufshcd_exception_event:
> :00:12.5: status 0x4
>kworker/2:2-173 [002] 732.609312: ufshcd_exception_event:
> :00:12.5: status 0x4
>
> Signed-off-by: Adrian Hunter
Reviewed-by: Avri Altman
fixes: 2b2bfc8aa519 (scsi: ufs: Introduce a quirk to allow only
page-aligned sg entries)
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshcd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index ee61f821f75d
>
> + /* for pre_req */
> + hpb->pre_req_min_tr_len = HPB_MULTI_CHUNK_LOW;
This actually needs to be bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD.
Also wasn't able to find any reference to fHPBen?
Thanks,
Avri
I 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 | 120
ate it.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 108 --
drivers/scsi/ufs/ufshpb.h | 7 +++
2 files changed, 100 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index e052260868ad..348185964c
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 | 20 +++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git
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 | 70 ++-
drivers/scsi/ufs/ufshpb.h | 7 +++
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 | 68 ++
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 9a1c525204f7..2c0f63a828ca 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
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 --
d Xiaomi Mi10 pro.
Your meticulous review and testing is mostly welcome and appreciated.
Thanks,
Avri
Avri Altman (9):
scsi: ufshpb: Cache HPB Control mode on init
scsi: ufshpb: Add host control mode support to rsp_upiu
scsi: ufshpb: Add region's reads counter
scsi: ufshpb: Make evi
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
> > +What:
> /sys/class/scsi_device/*/device/hpb_param_sysfs/timeout_polling_interval_ms
> > +Date:February 2021
> > +Contact: Avri Altman
> > +Description: the frequency in which the delayed worker that checks the
> > +
NG: use scnprintf or
> sprintf.
>
> Reported-by: Abaci Robot
> Signed-off-by: Jiapeng Chong
Reviewed-by: Avri Altman
> >
> > +static enum UFSHPB_MODE ufshpb_mode;
>
> How are you allowed to have a single variable for a device-specific
> thing? What happens when you have two controllers or disks or whatever
> you are binding to here? How does this work at all?
>
> This should be per-device, right?
Right. Done.
>
>
> On Wed, Jan 27, 2021 at 05:12:11PM +0200, Avri Altman wrote:
> > There are some limitations to activations / inactivations in host
> > control mode - Add those.
>
> I can not understand this changelog text, please make it more
> descriptive as I have no
> On Sun, Jan 31, 2021 at 07:08:00AM +0000, Avri Altman wrote:
> > > >
> > > > +static enum UFSHPB_MODE ufshpb_mode;
> > >
> > > How are you allowed to have a single variable for a device-specific
> > > thing? What happens when you have two
> >
> > + if (ufshpb_mode == HPB_HOST_CONTROL)
> > + reads = atomic64_inc_return(&rgn->reads);
> > +
> > if (!ufshpb_is_support_chunk(transfer_len))
> > return;
> >
> > + if (ufshpb_mode == HPB_HOST_CONTROL) {
> > + /*
> > + * in host
> > + /* region "cold" timer - for host mode */
> > + ktime_t read_timeout;
> > + atomic_t read_timeout_expiries;
>
> Why does this have to be an atomic when you have a lock to protect this
> structure already taken?
Done.
You are right, it is protected by the hpb state lock. Will fi
>
> Exporting functions ufshcd_set_dev_pwr_mode, ufshcd_disable_vreg
> and ufshcd_enable_vreg so that vendor drivers can make use of
> them in setting vendor specific regulator setting
> in vendor specific file.
As for ufshcd_{enable,disable}_vreg - maybe inline ufshcd_toggle_vreg and use
it inst
>
> UFS specification allows different VCC configurations for UFS devices,
> for example,
> (1)2.70V - 3.60V (For UFS 2.x devices)
> (2)2.40V - 2.70V (For UFS 3.x devices)
> For platforms supporting both ufs 2.x (2.7v-3.6v) and
> ufs 3.x (2.4v-2.7v), the voltage requirements (VCC)
> > +#define WORK_PENDING 0
> > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
> Rather than fixing it with macro, how about using sysfs and make it
> configurable?
Yes.
I will add a patch making all the logic configurable.
As all those are hpb-related parameters, I think module parameters are more
ade
>
>
> Hi Avri,
>
> > + /*
> > + * in host control mode, verify that the exiting region
> > + * has less reads
> > + */
> > + if (ufshpb_mode == HPB_HOST_CONTROL &&
> > + atomic64_read(&rgn->reads) > (EVICTION_THRSHLD
>
> Hi Avri,
>
> > + list_for_each_entry_safe(rgn, next_rgn, &lru_info->lh_lru_rgn,
> > + list_lru_rgn)
> How about replace list_for_each_entry_safe to list_for_each_entry?
Done.
Can also use the relaxed version in the timeout handler as well (patch 7/8).
Thanks,
>
> On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote:
> > > > +#define WORK_PENDING 0
> > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
> > > Rather than fixing it with macro, how about using sysfs and make it
> > > configurable?
>
>
> On Mon, Feb 01, 2021 at 07:51:19AM +, Avri Altman wrote:
> > >
> > > On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote:
> > > > > > +#define WORK_PENDING 0
> > > > > > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
> >
> On Mon, Feb 01, 2021 at 08:17:59AM +0000, Avri Altman wrote:
> > >
> > > On Mon, Feb 01, 2021 at 07:51:19AM +, Avri Altman wrote:
> > > > >
> > > > > On Mon, Feb 01, 2021 at 07:12:53AM +, Avri Altman wrote:
> > >
Daejun,
> static const struct attribute_group *ufshcd_driver_groups[] = {
> &ufs_sysfs_unit_descriptor_group,
> &ufs_sysfs_lun_attributes_group,
> +#ifdef CONFIG_SCSI_UFS_HPB
> + &ufs_sysfs_hpb_stat_group,
> +#endif
> NULL,
> };
Aren’t you creating a hpb_stats entri
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 --
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 | 35 +++
drivers/scs
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 | 42 ---
1 file changed, 39 insertions(+), 3
ate it.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshpb.c | 109 --
drivers/scsi/ufs/ufshpb.h | 6 +++
2 files changed, 100 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/ufs/ufshpb.c b/drivers/scsi/ufs/ufshpb.c
index 61de80a778a7..de4866d42d
I 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 | 119
4e6282b76ad9ae6c99e3ab5@epcms2p6
in lore.kernel.org. The patches are also available in wdc ufs repo:
https://github.com/westerndigitalcorporation/WDC-UFS-REPO/tree/hpb-v19
This version was tested on Galaxy S20, and Xiaomi Mi10 pro.
Your meticulous review and testing is mostly welcome and appreciated.
Th
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
the read_timeouts is awaken.
Signed-off-by: Avri Altman
---
drivers/scsi/ufs/ufshcd.c | 1 +
drivers/scsi/ufs/ufshpb.c | 284 +++---
drivers/scsi/ufs/ufshpb.h | 22 +++
3 files changed, 290 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.
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 | 76 ++-
drivers/scsi/ufs/ufshpb.h | 6 +++
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 c61fda95e35a..cec6f641a103 100644
--- a/drivers/scsi/ufs
>
> On Tue, Feb 02, 2021 at 10:30:07AM +0200, Avri Altman wrote:
> > +struct attribute_group ufs_sysfs_hpb_param_group = {
> > + .name = "hpb_param_sysfs",
>
> Shouldn't this be "hpb_param"? Why the trailing "_sysfs", doesn't that
> look odd in the directory path?
Done.
> >
> > - timeout_polling_interval_ms - the frequency in which the delayed
> > worker that checks the read_timeouts is awaken.
>
> You create new sysfs files, but fail to document them in
> Documentation/ABI/ which is where the above information needs to go :(
Done.
Will wait to see where Dae
> >
> > +#define WORK_PENDING 0
>
> This should be next to the variable you define that uses this, right?
> Otherwise we would think this is a valid value, when in reality it is
> the bit number, correct?
Done.
>
> > +#define ACTIVATION_THRSHLD 4 /* 4 IOs */
>
> You can spell things out "ACTIVA
>
> On Tue, Feb 02, 2021 at 10:30:00AM +0200, Avri Altman wrote:
> > diff --git a/drivers/scsi/ufs/ufshpb.h b/drivers/scsi/ufs/ufshpb.h
> > index afeb6365daf8..5ec4023db74d 100644
> > --- a/drivers/scsi/ufs/ufshpb.h
> > +++ b/drivers/scsi/ufs/ufshpb.h
> >
>
>
> On Tue, Feb 02, 2021 at 10:30:01AM +0200, Avri Altman wrote:
> > @@ -175,6 +179,8 @@ struct ufshpb_lu {
> >
> > /* for selecting victim */
> > struct victim_select_info lru_info;
> > + struct work_struct ufshpb_normalization_work;
> On Tue, Feb 02, 2021 at 11:24:04AM +0000, Avri Altman wrote:
> >
> > >
> > > On Tue, Feb 02, 2021 at 10:30:00AM +0200, Avri Altman wrote:
> > > > diff --git a/drivers/scsi/ufs/ufshpb.h b/drivers/scsi/ufs/ufshpb.h
> > > > index afeb6365daf8.
1 - 100 of 509 matches
Mail list logo