mmc:sdhci-bayhub:fix Qualcomm sd host 7180 SD card compatibility issue
Subsystems (4)
PATCH v2 1/1 mmc:sdhci-bayhub:fix Qualcomm sd host 7180 SD card compatibility issue
Improve the signal integrity for long SD bus trace by using SC7180+GGC SD host redriver chip
1.GGC is a SD bus signal re-timing IC that has been paired with the SC7180 sometimes.
2.The key points are initialized GGC chip during SD initialization and use GGC special tuning flow to re-timing SD bus signal. 3.GGC resource is initialized for GGC chip during Qualcomm host probe:
3.1 GGC structure initialization
3.2 GGC GPIO resource apply
3.3 Implement GGC chip special initialization function with "host->mmc_host_ops.init_card" callback.
3.4 Reload host->mmc->detect with GGC chip special initiation flow.
3.5 Reload the host->mmc_host_ops.execute_tuning with GGC chip special tuning flow.
4.The function of the patch is already verified on Chrome OS, and Google request us to submit the patch to Linux for them future use. 5.GGC can work with any other standard SDHCI controller to improve SD signal SI and Timing.
6.GGC has cooperated with Intel/Qualcomm/MTK/SPRD sd host already and work well.
---
changes in V2:
1.rebase the patch on kernel version 5.16.
2.remove some unused variables and functions base on V1. 3.add some annotation in code to distinguish bayhub GGC patch.
changes in V1:
1.copy Qualcomm driver base from sdhci-msm.c to sdhci-bayhub.c 2.implement the BH201 chip initialization function at sdhci-bayhub.c 3.implement the BH201 chip power control function at sdhci-bayhub.c 4.implement the BH201 chip tuning function at sdhci-bayhub.c 5.re-implement mmc_rescan to match BH201 mode switch flow at sdhci-bayhub.c
--- .../devicetree/bindings/mmc/sdhci-msm.txt | 1 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-bayhub.c | 6906 +++++++++++++++++ 3 files changed, 6908 insertions(+) create mode 100644 drivers/mmc/host/sdhci-bayhub.c
Documentation/devicetree/bindings/mmc/sdhci-msm.txt +1 -0
@@ -24,6 +24,7 @@ Required properties: "qcom,sdm845-sdhci", "qcom,sdhci-msm-v5" "qcom,sdx55-sdhci", "qcom,sdhci-msm-v5"; "qcom,sm8250-sdhci", "qcom,sdhci-msm-v5" + "qcom,sc7180-ggc-sdhci", "qcom,sdhci-msm-bayhub-v5" NOTE that some old device tree files may be floating around that only have the string "qcom,sdhci-msm-v4" without the SoC compatible string but doing that should be considered a deprecated practice.
drivers/mmc/host/Makefile +1 -0
@@ -92,6 +92,7 @@ obj-$(CONFIG_MMC_SDHCI_OF_SPARX5) += sdhci-of-sparx5.o obj-$(CONFIG_MMC_SDHCI_BCM_KONA) += sdhci-bcm-kona.o obj-$(CONFIG_MMC_SDHCI_IPROC) += sdhci-iproc.o obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-msm.o +obj-$(CONFIG_MMC_SDHCI_MSM) += sdhci-bayhub.o obj-$(CONFIG_MMC_SDHCI_ST) += sdhci-st.o obj-$(CONFIG_MMC_SDHCI_MICROCHIP_PIC32) += sdhci-pic32.o obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
drivers/mmc/host/sdhci-bayhub.c new file +6906 -0
2,986 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.32.0
Part of the diff is not shown here. View the raw message.
kernel test robot
build botThank you for the patch! Yet something to improve:
Hi Chevron,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on robh/for-next]
[also build test ERROR on linux/master linus/master v5.16-rc8] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chevron-Li/mmc-sdhci-bayhub-fix-Qualcomm-sd-host-7180-SD-card-compatibility-issue/20220105-203109 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: mips-allmodconfig (https://download.01.org/0day-ci/archive/20220106/202201060751.sKVVMT8D-lkp(a)intel.com/config) compiler: mips-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/26adf9f047e13b3b5a025c2a4c7eccb1db2af050
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chevron-Li/mmc-sdhci-bayhub-fix-Qualcomm-sd-host-7180-SD-card-compatibility-issue/20220105-203109 git checkout 26adf9f047e13b3b5a025c2a4c7eccb1db2af050
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
All error/warnings (new ones prefixed by >>, old ones prefixed by <<):
ERROR: modpost: missing MODULE_LICENSE() in drivers/pci/controller/pcie-mt7621.o
>> ERROR: modpost: "mmc_attach_mmc" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_attach_sdio" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_send_if_cond_pcie" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "sdio_reset" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_pwrseq_reset" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_power_up" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_add_card" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_spi_read_ocr" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_go_idle" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
>> ERROR: modpost: "mmc_select_voltage" [drivers/mmc/host/sdhci-bayhub.ko] undefined!
WARNING: modpost: suppressed 34 unresolved symbol warnings because there were too many)
--
>> drivers/mmc/host/sdhci-bayhub.c:2265:5: warning: no previous prototype for 'mmc_app_set_clr_card_detect' [-Wmissing-prototypes]
2265 | int mmc_app_set_clr_card_detect(struct mmc_card *card)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:3291:6: warning: no previous prototype for 'mmc_rescan_bayhub' [-Wmissing-prototypes]
3291 | void mmc_rescan_bayhub(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c: In function 'dump_array':
>> drivers/mmc/host/sdhci-bayhub.c:4154:12: warning: variable 'str' set but not used [-Wunused-but-set-variable]
4154 | u8 str[12] = { 0 };
| ^~~
drivers/mmc/host/sdhci-bayhub.c: At top level:
>> drivers/mmc/host/sdhci-bayhub.c:4232:6: warning: no previous prototype for 'no_fail_p' [-Wmissing-prototypes]
4232 | void no_fail_p(u8 *tuning_win, u8 *mid_val, u8 *max_pass_win, u8 *first_val)
| ^~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4254:6: warning: no previous prototype for 'tx_selb_calculate_valid_phase_range' [-Wmissing-prototypes]
4254 | void tx_selb_calculate_valid_phase_range(u32 val, int *start,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4270:6: warning: no previous prototype for 'ggc_update_default_selb_phase_tuning_cnt' [-Wmissing-prototypes]
4270 | bool ggc_update_default_selb_phase_tuning_cnt(struct sdhci_host *host, int selb,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4310:5: warning: no previous prototype for 'sdhci_bht_sdr50_execute_tuning' [-Wmissing-prototypes]
4310 | int sdhci_bht_sdr50_execute_tuning(struct sdhci_host *host, u32 opcode)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4371:5: warning: no previous prototype for 'get_config_sela_setting' [-Wmissing-prototypes]
4371 | int get_config_sela_setting(struct sdhci_host *host)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4382:5: warning: no previous prototype for 'get_config_selb_setting' [-Wmissing-prototypes]
4382 | int get_config_selb_setting(struct sdhci_host *host)
| ^~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4393:5: warning: no previous prototype for 'get_all_sela_status' [-Wmissing-prototypes]
4393 | u32 get_all_sela_status(struct sdhci_host *host, u32 target_selb)
| ^~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4407:5: warning: no previous prototype for 'get_pass_window_weight' [-Wmissing-prototypes]
4407 | int get_pass_window_weight(u32 val)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4419:5: warning: no previous prototype for 'get_sela_nearby_pass_window' [-Wmissing-prototypes]
4419 | int get_sela_nearby_pass_window(u32 sela, u32 base)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4457:5: warning: no previous prototype for 'get_left_one_sel' [-Wmissing-prototypes]
4457 | int get_left_one_sel(int base)
| ^~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4465:5: warning: no previous prototype for 'get_right_one_sel' [-Wmissing-prototypes]
4465 | int get_right_one_sel(int base)
| ^~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4473:5: warning: no previous prototype for 'get_dif' [-Wmissing-prototypes]
4473 | int get_dif(int x, int y)
| ^~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4667:6: warning: no previous prototype for 'tx_selb_inject_policy' [-Wmissing-prototypes]
4667 | void tx_selb_inject_policy(struct sdhci_host *host, int tx_selb)
| ^~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4686:5: warning: no previous prototype for 'get_selb_failure_point' [-Wmissing-prototypes]
4686 | int get_selb_failure_point(int start, u64 raw_tx_selb, int tuning_cnt)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4726:6: warning: no previous prototype for 'selx_failure_point_exist' [-Wmissing-prototypes]
4726 | bool selx_failure_point_exist(u32 val)
| ^~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4736:5: warning: no previous prototype for '_get_best_window_phase' [-Wmissing-prototypes]
4736 | int _get_best_window_phase(u32 vct, int *pmax_pass_win, int shif_left_flg)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/mmc/host/sdhci-bayhub.c:4802:5: warning: no previous prototype for 'get_best_window_phase' [-Wmissing-prototypes]
4802 | int get_best_window_phase(u32 vct, int *pmax_pass_win)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c:4845:6: warning: no previous prototype for 'ggc_hw_inject_ext' [-Wmissing-prototypes]
4845 | bool ggc_hw_inject_ext(struct sdhci_host *host, bool *card_status,
| ^~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c:4881:6: warning: no previous prototype for '_ggc_hw_inject_may_recursive' [-Wmissing-prototypes]
4881 | bool _ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/mmc/host/sdhci-bayhub.c:4914:6: warning: no previous prototype for 'ggc_hw_inject_may_recursive' [-Wmissing-prototypes]
4914 | bool ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c:4920:6: warning: no previous prototype for 'get_next_dll_voltage' [-Wmissing-prototypes]
4920 | bool get_next_dll_voltage(int cur, int *next, u32 *dll_voltage_unlock_cnt,
| ^~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c:4963:6: warning: no previous prototype for 'ggc_sw_calc_tuning_result' [-Wmissing-prototypes]
4963 | bool ggc_sw_calc_tuning_result(struct sdhci_host *host, bool *card_status,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-bayhub.c:5038:6: warning: no previous prototype for '_ggc_calc_cur_sela_tuning_result' [-Wmissing-prototypes]
5038 | bool _ggc_calc_cur_sela_tuning_result(struct sdhci_host *host, int cur_sela, int start_selb)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
kernel test robot
build botThank you for the patch! Perhaps something to improve:
Hi Chevron,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.16-rc8 next-20220105] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Chevron-Li/mmc-sdhci-bayhub-fix-Qualcomm-sd-host-7180-SD-card-compatibility-issue/20220105-203109 base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next config: hexagon-randconfig-r013-20220105 (https://download.01.org/0day-ci/archive/20220106/202201061011.BhumpCCg-lkp(a)intel.com/config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project d5b6e30ed3acad794dd0aec400e617daffc6cc3d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/26adf9f047e13b3b5a025c2a4c7eccb1db2af050
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Chevron-Li/mmc-sdhci-bayhub-fix-Qualcomm-sd-host-7180-SD-card-compatibility-issue/20220105-203109 git checkout 26adf9f047e13b3b5a025c2a4c7eccb1db2af050
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/mmc/host/ mm/
If you fix the issue, kindly add following tag as appropriate
All warnings (new ones prefixed by >>):
>> drivers/mmc/host/sdhci-bayhub.c:2265:5: warning: no previous prototype for function 'mmc_app_set_clr_card_detect' [-Wmissing-prototypes]
int mmc_app_set_clr_card_detect(struct mmc_card *card)
^
drivers/mmc/host/sdhci-bayhub.c:2265:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int mmc_app_set_clr_card_detect(struct mmc_card *card)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:3291:6: warning: no previous prototype for function 'mmc_rescan_bayhub' [-Wmissing-prototypes]
void mmc_rescan_bayhub(struct work_struct *work)
^
drivers/mmc/host/sdhci-bayhub.c:3291:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void mmc_rescan_bayhub(struct work_struct *work)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4232:6: warning: no previous prototype for function 'no_fail_p' [-Wmissing-prototypes]
void no_fail_p(u8 *tuning_win, u8 *mid_val, u8 *max_pass_win, u8 *first_val)
^
drivers/mmc/host/sdhci-bayhub.c:4232:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void no_fail_p(u8 *tuning_win, u8 *mid_val, u8 *max_pass_win, u8 *first_val)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4254:6: warning: no previous prototype for function 'tx_selb_calculate_valid_phase_range' [-Wmissing-prototypes]
void tx_selb_calculate_valid_phase_range(u32 val, int *start,
^
drivers/mmc/host/sdhci-bayhub.c:4254:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void tx_selb_calculate_valid_phase_range(u32 val, int *start,
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4270:6: warning: no previous prototype for function 'ggc_update_default_selb_phase_tuning_cnt' [-Wmissing-prototypes]
bool ggc_update_default_selb_phase_tuning_cnt(struct sdhci_host *host, int selb,
^
drivers/mmc/host/sdhci-bayhub.c:4270:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool ggc_update_default_selb_phase_tuning_cnt(struct sdhci_host *host, int selb,
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4310:5: warning: no previous prototype for function 'sdhci_bht_sdr50_execute_tuning' [-Wmissing-prototypes]
int sdhci_bht_sdr50_execute_tuning(struct sdhci_host *host, u32 opcode)
^
drivers/mmc/host/sdhci-bayhub.c:4310:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int sdhci_bht_sdr50_execute_tuning(struct sdhci_host *host, u32 opcode)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4371:5: warning: no previous prototype for function 'get_config_sela_setting' [-Wmissing-prototypes]
int get_config_sela_setting(struct sdhci_host *host)
^
drivers/mmc/host/sdhci-bayhub.c:4371:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_config_sela_setting(struct sdhci_host *host)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4382:5: warning: no previous prototype for function 'get_config_selb_setting' [-Wmissing-prototypes]
int get_config_selb_setting(struct sdhci_host *host)
^
drivers/mmc/host/sdhci-bayhub.c:4382:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_config_selb_setting(struct sdhci_host *host)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4393:5: warning: no previous prototype for function 'get_all_sela_status' [-Wmissing-prototypes]
u32 get_all_sela_status(struct sdhci_host *host, u32 target_selb)
^
drivers/mmc/host/sdhci-bayhub.c:4393:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u32 get_all_sela_status(struct sdhci_host *host, u32 target_selb)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4407:5: warning: no previous prototype for function 'get_pass_window_weight' [-Wmissing-prototypes]
int get_pass_window_weight(u32 val)
^
drivers/mmc/host/sdhci-bayhub.c:4407:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_pass_window_weight(u32 val)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4419:5: warning: no previous prototype for function 'get_sela_nearby_pass_window' [-Wmissing-prototypes]
int get_sela_nearby_pass_window(u32 sela, u32 base)
^
drivers/mmc/host/sdhci-bayhub.c:4419:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_sela_nearby_pass_window(u32 sela, u32 base)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4457:5: warning: no previous prototype for function 'get_left_one_sel' [-Wmissing-prototypes]
int get_left_one_sel(int base)
^
drivers/mmc/host/sdhci-bayhub.c:4457:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_left_one_sel(int base)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4465:5: warning: no previous prototype for function 'get_right_one_sel' [-Wmissing-prototypes]
int get_right_one_sel(int base)
^
drivers/mmc/host/sdhci-bayhub.c:4465:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_right_one_sel(int base)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4473:5: warning: no previous prototype for function 'get_dif' [-Wmissing-prototypes]
int get_dif(int x, int y)
^
drivers/mmc/host/sdhci-bayhub.c:4473:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_dif(int x, int y)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4667:6: warning: no previous prototype for function 'tx_selb_inject_policy' [-Wmissing-prototypes]
void tx_selb_inject_policy(struct sdhci_host *host, int tx_selb)
^
drivers/mmc/host/sdhci-bayhub.c:4667:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void tx_selb_inject_policy(struct sdhci_host *host, int tx_selb)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4686:5: warning: no previous prototype for function 'get_selb_failure_point' [-Wmissing-prototypes]
int get_selb_failure_point(int start, u64 raw_tx_selb, int tuning_cnt)
^
drivers/mmc/host/sdhci-bayhub.c:4686:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_selb_failure_point(int start, u64 raw_tx_selb, int tuning_cnt)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4726:6: warning: no previous prototype for function 'selx_failure_point_exist' [-Wmissing-prototypes]
bool selx_failure_point_exist(u32 val)
^
drivers/mmc/host/sdhci-bayhub.c:4726:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool selx_failure_point_exist(u32 val)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4736:5: warning: no previous prototype for function '_get_best_window_phase' [-Wmissing-prototypes]
int _get_best_window_phase(u32 vct, int *pmax_pass_win, int shif_left_flg)
^
drivers/mmc/host/sdhci-bayhub.c:4736:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int _get_best_window_phase(u32 vct, int *pmax_pass_win, int shif_left_flg)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4802:5: warning: no previous prototype for function 'get_best_window_phase' [-Wmissing-prototypes]
int get_best_window_phase(u32 vct, int *pmax_pass_win)
^
drivers/mmc/host/sdhci-bayhub.c:4802:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int get_best_window_phase(u32 vct, int *pmax_pass_win)
^
static
>> drivers/mmc/host/sdhci-bayhub.c:4845:6: warning: no previous prototype for function 'ggc_hw_inject_ext' [-Wmissing-prototypes]
bool ggc_hw_inject_ext(struct sdhci_host *host, bool *card_status,
^
drivers/mmc/host/sdhci-bayhub.c:4845:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool ggc_hw_inject_ext(struct sdhci_host *host, bool *card_status,
^
static
drivers/mmc/host/sdhci-bayhub.c:4881:6: warning: no previous prototype for function '_ggc_hw_inject_may_recursive' [-Wmissing-prototypes]
bool _ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
^
drivers/mmc/host/sdhci-bayhub.c:4881:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool _ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
^
static
drivers/mmc/host/sdhci-bayhub.c:4914:6: warning: no previous prototype for function 'ggc_hw_inject_may_recursive' [-Wmissing-prototypes]
bool ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
^
drivers/mmc/host/sdhci-bayhub.c:4914:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool ggc_hw_inject_may_recursive(struct sdhci_host *host, u32 sel200,
^
static
drivers/mmc/host/sdhci-bayhub.c:4920:6: warning: no previous prototype for function 'get_next_dll_voltage' [-Wmissing-prototypes]
bool get_next_dll_voltage(int cur, int *next, u32 *dll_voltage_unlock_cnt,
^
drivers/mmc/host/sdhci-bayhub.c:4920:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool get_next_dll_voltage(int cur, int *next, u32 *dll_voltage_unlock_cnt,
^
static
drivers/mmc/host/sdhci-bayhub.c:4963:6: warning: no previous prototype for function 'ggc_sw_calc_tuning_result' [-Wmissing-prototypes]
bool ggc_sw_calc_tuning_result(struct sdhci_host *host, bool *card_status,
^
drivers/mmc/host/sdhci-bayhub.c:4963:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
bool ggc_sw_calc_tuning_result(struct sdhci_host *host, bool *card_status,
^
static
drivers/mmc/host/sdhci-bayhub.c:5038:6: warning: no previous prototype for function '_ggc_calc_cur_sela_tuning_result' [-Wmissing-prototypes]
bool _ggc_calc_cur_sela_tuning_result(struct sdhci_host *host, int cur_sela, int start_selb)
^ drivers/mmc/host/sdhci-bayhub.c:5038:1: note: declare 'static' if the function is not intended to be used outside of this translation unit bool _ggc_calc_cur_sela_tuning_result(struct sdhci_host *host, int cur_sela, int start_selb)
^
static
25 warnings generated.
vim +/mmc_app_set_clr_card_detect +2265 drivers/mmc/host/sdhci-bayhub.c
2264
> 2265 int mmc_app_set_clr_card_detect(struct mmc_card *card)
2266 {
2267 struct mmc_command cmd = {};
2268
2269 cmd.opcode = 42;
2270 cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
2271
2272 return mmc_wait_for_app_cmd(card->host, card, &cmd);
2273 }
2274 /*
2275 * UHS-I specific initialization procedure
2276 */
2277 static int mmc_sd_init_uhs_card(struct mmc_card *card)
2278 {
2279 int err;
2280 u8 *status;
2281
2282 if (!(card->csd.cmdclass & CCC_SWITCH))
2283 return 0;
2284
2285 status = kmalloc(64, GFP_KERNEL);
2286 if (!status)
2287 return -ENOMEM;
2288
2289 /* Set 4-bit bus width */
2290 err = mmc_app_set_bus_width(card, MMC_BUS_WIDTH_4);
2291 if (err)
2292 goto out;
2293
2294 mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
2295
2296 /*
2297 * Select the bus speed mode depending on host
2298 * and card capability.
2299 */
2300 sd_update_bus_speed_mode(card);
2301
2302 /* GGC chip need this command to switch mode */
2303 mmc_app_set_clr_card_detect(card);
2304
2305 /* Set the driver strength for the card */
2306 err = sd_select_driver_type(card, status);
2307 if (err)
2308 goto out;
2309
2310 /* Set current limit for the card */
2311 err = sd_set_current_limit(card, status);
2312 if (err)
2313 goto out;
2314
2315 /* Set bus speed mode of the card */
2316 err = sd_set_bus_speed_mode(card, status);
2317 if (err)
2318 goto out;
2319
2320 /*
2321 * SPI mode doesn't define CMD19 and tuning is only valid for SDR50 and
2322 * SDR104 mode SD-cards. Note that tuning is mandatory for SDR104.
2323 */
2324 if (!mmc_host_is_spi(card->host) &&
2325 (card->host->ios.timing == MMC_TIMING_UHS_SDR50 ||
2326 card->host->ios.timing == MMC_TIMING_UHS_DDR50 || 2327 card->host->ios.timing == MMC_TIMING_UHS_SDR104)) {
2328 err = mmc_execute_tuning(card);
2329
2330 /*
2331 * As SD Specifications Part1 Physical Layer Specification
2332 * Version 3.01 says, CMD19 tuning is available for unlocked
2333 * cards in transfer state of 1.8V signaling mode. The small
2334 * difference between v3.00 and 3.01 spec means that CMD19
2335 * tuning is also available for DDR50 mode.
2336 */
2337 if (err && card->host->ios.timing == MMC_TIMING_UHS_DDR50) {
2338 pr_warn("%s: ddr50 tuning failed\n",
2339 mmc_hostname(card->host));
2340 err = 0;
2341 }
2342 }
2343
2344 out:
2345 kfree(status);
2346
2347 return err;
2348 }
2349
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org