Skip to content

Commit

Permalink
drivers: sdhc: brcm_bcm2712: add sdhc_command retry
Browse files Browse the repository at this point in the history
Add proper handling of sdhc_command->retries for SDHC requests.

Signed-off-by: Grygorii Strashko <[email protected]>
Acked-by: Mykola Kvach <[email protected]>
Acked-by: Oleksii Moisieiev <[email protected]>
Acked-by: Dmytro Firsov <[email protected]>
  • Loading branch information
Grygorii Strashko committed Aug 7, 2024
1 parent bcfc843 commit b06582f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/sdhc/brcm_bcm2712_sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ static int bcm2712_sdhci_request(const struct device *dev, struct sdhc_command *
struct sdhc_data *sd_data)
{
struct bcm2712_sdhci_data *data = dev->data;
unsigned int retry = cmd->retries;
int ret;

ret = sdhci_send_req(&data->sdhci_ctx, cmd, sd_data);
if (ret) {
LOG_DEV_ERR(dev, "sd cmd request failed (%d)", ret);
}
do {
ret = sdhci_send_req(&data->sdhci_ctx, cmd, sd_data);
if (ret) {
LOG_DEV_ERR(dev, "sd cmd request failed (%d)", ret);
}
} while (ret != 0 && retry--);
return ret;
}

Expand Down

0 comments on commit b06582f

Please sign in to comment.