Skip to content

Commit e8012ff

Browse files
Phil Elwellgregkh
authored andcommitted
mmc: bcm2835: Don't overwrite max frequency unconditionally
commit 118032b upstream. The optional DT parameter max-frequency could init the max bus frequency. So take care of this, before setting the max bus frequency. Fixes: 660fc73 ("mmc: bcm2835: Add new driver for the sdhost controller.") Signed-off-by: Phil Elwell <phil@raspberrypi.org> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Cc: <stable@vger.kernel.org> # 4.12+ Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a1341ca commit e8012ff

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/mmc/host/bcm2835.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,8 @@ static int bcm2835_add_host(struct bcm2835_host *host)
12651265
char pio_limit_string[20];
12661266
int ret;
12671267

1268-
mmc->f_max = host->max_clk;
1268+
if (!mmc->f_max || mmc->f_max > host->max_clk)
1269+
mmc->f_max = host->max_clk;
12691270
mmc->f_min = host->max_clk / SDCDIV_MAX_CDIV;
12701271

12711272
mmc->max_busy_timeout = ~0 / (mmc->f_max / 1000);

0 commit comments

Comments
 (0)