Skip to contentSkip to conversation

mmc_card_blockaddr() now private

DISCUSSION Jan Glauber 2 participants 2 messages Jan 30, 2017 – Feb 2, 2017 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

Hi,

preparing mmc patches against linux-next I noticed that mmc_card_blockaddr is now private to the mmc core.

We've been using that in the (not yet upstream) Cavium mmc driver like this:

static void prepare_ext_dma(struct mmc_host *mmc, ...

	...
	emm_dma->s.sector = mmc_card_blockaddr(mmc->card) ? 1 : 0;

So the hardware controller needs to know if we use 512 byte blocks or not which seems to be dependent on the medium size.

Any ideas on how I can implement this without mmc_card_blockaddr() ?

thanks,
Jan

#1 lore raw
Quoted 7 lines · Jan Glauber

Hi,

preparing mmc patches against linux-next I noticed that mmc_card_blockaddr is now private to the mmc core.

We've been using that in the (not yet upstream) Cavium mmc driver like this:

Quoted 7 lines

static void prepare_ext_dma(struct mmc_host *mmc, ...

        ...
        emm_dma->s.sector = mmc_card_blockaddr(mmc->card) ? 1 : 0;

So the hardware controller needs to know if we use 512 byte blocks or not which seems to be dependent on the medium size.

mmc_card_blockaddr() is not about the size of the block. Instead it tells how the card translate the address to the data.

For old cards, the address can be in bytes, while newer supports the address being a multiple of sectors.

Quoted 2 lines

Any ideas on how I can implement this without mmc_card_blockaddr() ?

Seems like you probably should use "blksz" from the struct mmc_data, which your driver receives as apart of the request.

Kind regards
Uffe