From: Stanley Chu <stanley.chu@mediatek.com>
To: <linux-scsi@vger.kernel.org>, <martin.petersen@oracle.com>,
<avri.altman@wdc.com>, <alim.akhtar@samsung.com>,
<jejb@linux.ibm.com>, <asutoshd@codeaurora.org>
Cc: bvanassche@acm.org, andy.teng@mediatek.com,
chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com,
linux-kernel@vger.kernel.org, cang@codeaurora.org,
linux-mediatek@lists.infradead.org, peter.wang@mediatek.com,
matthias.bgg@gmail.com, Stanley Chu <stanley.chu@mediatek.com>,
linux-arm-kernel@lists.infradead.org, beanhuo@micron.com
Subject: [PATCH v4 3/8] scsi: ufs: export ufs_fixup_device_setup() function
Date: Sun, 3 May 2020 14:03:46 +0800 [thread overview]
Message-ID: <20200503060351.10572-4-stanley.chu@mediatek.com> (raw)
In-Reply-To: <20200503060351.10572-1-stanley.chu@mediatek.com>
Export ufs_fixup_device_setup() to allow vendors to re-use it for
fixing device quriks on specified UFS hosts.
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
---
drivers/scsi/ufs/ufshcd.c | 7 ++++---
drivers/scsi/ufs/ufshcd.h | 4 +++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index da7b375709b6..6d5b49c07a69 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -6838,12 +6838,12 @@ static void ufshcd_wb_probe(struct ufs_hba *hba, u8 *desc_buf)
hba->caps &= ~UFSHCD_CAP_WB_EN;
}
-static void ufs_fixup_device_setup(struct ufs_hba *hba)
+void ufshcd_fixup_device_setup(struct ufs_hba *hba, struct ufs_dev_fix *fixups)
{
struct ufs_dev_fix *f;
struct ufs_dev_info *dev_info = &hba->dev_info;
- for (f = ufs_fixups; f->quirk; f++) {
+ for (f = fixups; f->quirk; f++) {
if ((f->wmanufacturerid == dev_info->wmanufacturerid ||
f->wmanufacturerid == UFS_ANY_VENDOR) &&
((dev_info->model &&
@@ -6852,6 +6852,7 @@ static void ufs_fixup_device_setup(struct ufs_hba *hba)
hba->dev_quirks |= f->quirk;
}
}
+EXPORT_SYMBOL_GPL(ufshcd_fixup_device_setup);
static int ufs_get_device_desc(struct ufs_hba *hba)
{
@@ -6898,7 +6899,7 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
goto out;
}
- ufs_fixup_device_setup(hba);
+ ufshcd_fixup_device_setup(hba, ufs_fixups);
ufshcd_vops_fixup_dev_quirks(hba);
/*
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h
index 5fa03e0f3bd1..f34601121880 100644
--- a/drivers/scsi/ufs/ufshcd.h
+++ b/drivers/scsi/ufs/ufshcd.h
@@ -69,6 +69,7 @@
#include <scsi/scsi_eh.h>
#include "ufs.h"
+#include "ufs_quirks.h"
#include "ufshci.h"
#define UFSHCD "ufshcd"
@@ -951,7 +952,8 @@ int ufshcd_query_flag(struct ufs_hba *hba, enum query_opcode opcode,
void ufshcd_auto_hibern8_enable(struct ufs_hba *hba);
void ufshcd_auto_hibern8_update(struct ufs_hba *hba, u32 ahit);
-
+void ufshcd_fixup_device_setup(struct ufs_hba *hba,
+ struct ufs_dev_fix *fixups);
#define SD_ASCII_STD true
#define SD_RAW false
int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index,
--
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-05-03 6:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-03 6:03 [PATCH v4 0/8] scsi: ufs: support LU Dedicated buffer mode for WriteBooster Stanley Chu
2020-05-03 6:03 ` [PATCH v4 1/8] scsi: ufs: enable WriteBooster on some pre-3.1 UFS devices Stanley Chu
2020-05-03 6:03 ` [PATCH v4 2/8] scsi: ufs: introduce fixup_dev_quirks vops Stanley Chu
2020-05-03 6:03 ` Stanley Chu [this message]
2020-05-03 6:03 ` [PATCH v4 4/8] scsi: ufs-mediatek: add " Stanley Chu
2020-05-03 6:03 ` [PATCH v4 5/8] scsi: ufs: add "index" in parameter list of ufshcd_query_flag() Stanley Chu
2020-05-03 6:03 ` [PATCH v4 6/8] scsi: ufs: add LU Dedicated buffer mode support for WriteBooster Stanley Chu
2020-05-03 8:00 ` Avri Altman
2020-05-03 10:39 ` Stanley Chu
2020-05-03 6:03 ` [PATCH v4 7/8] scsi: ufs-mediatek: enable WriteBooster capability Stanley Chu
2020-05-03 6:03 ` [PATCH v4 8/8] scsi: ufs: cleanup WriteBooster feature Stanley Chu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200503060351.10572-4-stanley.chu@mediatek.com \
--to=stanley.chu@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=andy.teng@mediatek.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cang@codeaurora.org \
--cc=chun-hung.wu@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=kuohong.wang@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matthias.bgg@gmail.com \
--cc=peter.wang@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox