Age | Commit message (Collapse) | Author | Files | Lines |
|
The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const. Thus the mmc_host_ops
structure itself can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };
@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct mmc_host_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const. Thus the mmc_host_ops
structure itself can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };
@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct mmc_host_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const. Thus the mmc_host_ops
structure itself can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };
@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct mmc_host_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const. Thus the mmc_host_ops
structure itself can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };
@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct mmc_host_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The mmc_host_ops structure is only stored in the ops field of an
mmc_host structure, which is declared as const. Thus the mmc_host_ops
structure itself can be const.
Done with the help of Coccinelle.
// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct mmc_host_ops i@p = { ... };
@ok1@
struct mmc_host *mmc;
identifier r.i;
position p;
@@
mmc->ops = &i@p
@bad@
position p != {r.p,ok1.p};
identifier r.i;
struct mmc_host_ops e;
@@
e@i@p
@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct mmc_host_ops i = { ... };
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Fix up a power state in case PCI device has an ACPI companion.
Do it only for Intel Merrifield for now.
This is almost copy'n'paste of part of sdhci_acpi_probe() and might be
split out to a helper function in the future.
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
ACPI_COMPANION() macro reduces a code to get a companion device out of
struct device.
Use it instead of an old method.
Signed-off-by: Andy Shevchenko <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Emmc DDR52 mode uses fixed delay, return earlier if
timing is MMC_TIMING_MMC_DDR52 in execute tuning function.
Signed-off-by: Zhoujie Wu <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Adrian Hunter <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Jonathan Hunter <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Ulf Hansson <[email protected]>
Cc: Maxime Ripard <[email protected]>
Cc: Chen-Yu Tsai <[email protected]>
Cc: [email protected]
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Patrice Chotard <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: [email protected]
Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Commit a53e35db70d1 ("reset: Ensure drivers are explicit when requesting
reset lines") started to transition the reset control request API calls
to explicitly state whether the driver needs exclusive or shared reset
control behavior. Convert all drivers requesting exclusive resets to the
explicit API call so the temporary transition helpers can be removed.
No functional changes.
Cc: Jaehoon Chung <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: [email protected]
Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <[email protected]>
Cc: Ulf Hansson <[email protected]>
Cc: Ludovic Desroches <[email protected]>
Cc: Jan Glauber <[email protected]>
Cc: David Daney <[email protected]>
Cc: "Steven J. Hill" <[email protected]>
Cc: [email protected]
Acked-by: David Daney <[email protected]>
Tested-by: Steven J. Hill <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
I cannot see why this is needed. kmap() should be safe in this case.
Signed-off-by: Ian Molton <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by <linux/pci.h> work with
const pci_device_id. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
6952 880 0 7832 1e98 drivers/mmc/host/via-sdmmc.o
File size After adding 'const':
text data bss dec hex filename
7032 800 0 7832 1e98 drivers/mmc/host/via-sdmmc.o
Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
sdhci uses CONFIG_MMC_DEBUG for showing ADMA descriptor
when occurring ADMA error. And it's also used to dump the
registers whenever calling sdhci_add_host.
On one hand, I don't see any burden to always print the state
ADMA descriptor as it's rare and will help folks better understand
what was happening when seeing ADMA error.
On the other, folks may be interested in checking some registers
at probe time. So we remove the sdhci_dumpregs from __sdhci_add_host
and print some really useful registers in sdhci_setup_host.
Suggested-by: Adrian Hunter <[email protected]>
Signed-off-by: Shawn Lin <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
wbsd only use this to print some unsupported command.
However the pr_warn should be enough for dynamic log
control and CONFIG_MMC_DEBUG seems bogus here. Remove it.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
We have removed all code depending on CONFIG_MMC_DEBUG
from mmc core now. So it's safe to make CONFIG_MMC_DEBUG
just for host drivers only and we expect to kill this option
in the future.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
There are lots of debug message in core.c which use pr_debug
for better dynamic log level control. So it doesn't make sense
for those print to still keep working only under CONFIG_MMC_DEBUG.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
All the check within mmc_mrq_prep seems to be all-or-none
proposition, so it doesn't make sense to only check the
length of sglist only under the CONFIG_MMC_DEBUG context.
I'd prefer to always keep the check there unconditionally.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The intention of this check was to prevent the conflict between
hotplug and removing driver for whatever reason. Currently it
doesn't improve anything and the following rescan process could
still saftly perform the scan flow. So these code seems pointless
now and let's remove them.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
It was never used and introduce a warning
drivers/mmc/host/sdhci-acpi.c: In function 'sdhci_acpi_sdio_probe_slot':
drivers/mmc/host/sdhci-acpi.c:297:21: warning: variable 'host' set but
not used [-Wunused-but-set-variable]
Signed-off-by: Shawn Lin <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This increases consistency of the code across the sdhci family.
Signed-off-by: Jean-Francois Dagenais <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Reviewed-by: Shawn Lin <[email protected]>
Tested-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
for_each_child_of_node performs an of_node_get on each iteration, so a
break out the loop requires an of_node_put.
The semantic patch that fixes this problem is as follows
(http://coccinelle.lip6.fr):
// <smpl>
@@
local idexpression n;
expression e,e1;
iterator name for_each_child_of_node;
@@
for_each_child_of_node(e1,n) {
...
(
of_node_put(n);
|
e = n
|
+ of_node_put(n);
? break;
)
...
}
... when != n
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
This adds deepest (Backup+Self-Refresh) PM support to the ATMEL SAMA5D2
SoC's SDHCI controller.
When resuming from deepest state, it is required to restore preset
registers as the registers are lost since VDD core has been shut down
when entering deepest state on the SAMA5D2. The clocks need to be
reconfigured as well.
The other registers and init process are taken care of by the SDHCI
core.
Signed-off-by: Quentin Schulz <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
The setting of clocks and presets is currently done in probe only but
once deep PM support is added, it'll be needed in the resume function.
Let's create a function for this setting.
Signed-off-by: Quentin Schulz <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Acked-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
We got a warning:
drivers/mmc/host/atmel-mci.c:1086:15: warning: variable 'sg_len' set but
not used [-Wunused-but-set-variable]
Ideally we should check to see if sg_len is zero but looking
into the code closely, I didn't find any possible to do that as
atmci_start_request didn't even deploy any error handling for
its host->prepare_data hook. So even we return error value for iflags
like what other host drivers did, for instance, sdhci and dwmmc, it still
need some extra work to improve the code.
Just remove it to silent the warning, although it isn't perfect.
Signed-off-by: Shawn Lin <[email protected]>
Acked-by: Ludovic Desroches <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
It was never used and leave a long standing compile warning:
drivers/mmc/host/sdhci-xenon.c: In function 'xenon_probe':
drivers/mmc/host/sdhci-xenon.c:447:21: warning: variable 'priv' set but
not used [-Wunused-but-set-variable]
Remove it to fix the warning.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
It was never used and introduced a long standing compile
warning:
drivers/mmc/core/block.c: In function 'power_ro_lock_store':
drivers/mmc/core/block.c:191:19: warning: variable 'card' set but not
used [-Wunused-but-set-variable]
Remove it to fix the warning.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
We got a compile warning for mxcmmc,
drivers/mmc/host/mxcmmc.c: In function 'mxcmci_data_done':
drivers/mmc/host/mxcmmc.c:661:6: warning: variable 'data_error' set but
not used [-Wunused-but-set-variable]
The easiest method is to remove the data_error. But looking into
the code closely, I think we should check the return value of
mxcmci_finish_data as if it got data->error(the same as data_error),
we shouldn't try to read the response.
Signed-off-by: Shawn Lin <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Just a trivial fix for that found by reading the code.
Signed-off-by: Shawn Lin <[email protected]>
Reviewed-by: Jaehoon Chung <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
if user plug out sd card slowly, finally card is plugged out but
cat /proc/partitions can find that card is still exist in kernel.
that's because alougth get card detect interrupt but CMD13 still
can get correct response(all other pins are connected expect card
detect pin).
add ops->get_cd() can avoid this issue.
Signed-off-by: Chaotian Jing <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
array width is on-stack and not modified and should be
made static const.
Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Most registers need to wait until the command is completed, not
necessarily until the bus is free. At least, R-Car 2+ SoCs can signal
that via the CBSY bit, so let's use it there instead of SCLKDIVEN to
save a little bit of delay.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Our hardware engineers confirmed that it is unnecessary to wait when
turning the clock on/off. The documentation was a tad vague, so we
used to play safe.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Use a proper define.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
When defining bits, make sure we always have a reference to the register
they belong to. For now, renaming all bits properly seems too intrusive,
so at least make sure we have proper documentation.
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Since commit 10c7fcbd0f00a0 ("ARM: shmobile: sh7372: Remove ZBOOT
MMC/SDHI support"), this define is not needed anymore.
Signed-off-by: Wolfram Sang <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
I always anticipated this code to be not correct, but now I had a test
case to prove it. According to all documentation I have, setting the
TMIO_STOP_STP bit ever only worked during block transfers. This bit is
like manually enforcing an autocmd12 during a so far seamless transfer.
It does NOT work when the block transfer had errors. It also does NOT
work with any other cmd except block commands. For all those, CMD12 has
to be treated like any other command. So, basically, we could use this
bit only for mrq->data->stop cmds. But for these, we happily use the
autocmd12 feature using the TMIO_STOP_SEC bit. As a result, the above
bit is not useful for us and we need to treat CMD12 as a regular cmd
always. Just remove the special handling code. Note that the BSP
recognized this issue as well yet had a more cautious solution to the
problem [1]. Which is understandable but makes CMD12 handling even more
complicated.
Checked with a Renesas Salvator-X/M3-W which needed to send CMD12 when
retuning one of my SD cards.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas-bsp.git/commit/?id=2838a2ff8ca776f6d18b7fbbe75f3df8dd64183a
Signed-off-by: Wolfram Sang <[email protected]>
Tested-by: Jan Klötzke <[email protected]>
Tested-by: Nguyen Viet Dung <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
platform_get_irq() returns an error code, but the mxcmmc driver
ignores it and always returns -EINVAL. This is not correct,
and prevents -EPROBE_DEFER from being propagated properly.
Print error message and propagate the return value of
platform_get_irq on failure.
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Local variable transfer_error is assigned to a constant value and
it is never updated again.
Remove this variable and the dead code it guards.
Addresses-Coverity-ID: 1222110
Signed-off-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
shdci-st driver can be used for ppc476 fsp2 soc.
Signed-off-by: Ivan Mikhaylov <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Reduce max_segs to 64, a value that allows allocation of an entire
EDMA descriptor list within a single page - EDMA descriptors
are 40 bytes and the header is much larger. This avoids doing a
higher order GFP_ATOMIC allocation in edma_prep_slave_sg
when setting up a transfer which can potentially fail due to
fragmentation under heavy I/O load.
The current value of 1024 is unusually high in comparison to
other mmc host drivers which mostly use values of between 1
and 256. The EDMA driver at present splits lists above 20
segments in any case so reducing the size of lists we pass to
it shouldn't add much overhead.
Signed-off-by: Will Newton <[email protected]>
Acked-by: Tony Lindgren <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Add a new variant of the SDHI driver to support R-Car Gen3 with DMA via
on-chip bus mastering. Since the DMAC is in a part of the SDHI module it
is not suitable to be used via DMA Engine.
Clearing of DM_CM_INFO1 after DMA thanks to Dirk Behme
Cc: Dirk Behme <[email protected]>
Signed-off-by: Yoshihiro Shimoda <[email protected]>
Signed-off-by: Ai Kyuse <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Add dataend to DMA ops to allow DMAC implementation dependent
handling of DMA data end.
Also implement the operation for SDHI.
Signed-off-by: Simon Horman <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Allow TMIO and SDHI driver implementations to provide values for
max_segs and max_blk_count.
A follow-up patch will set these values for Renesas Gen3 SoCs
the using an SDHI driver.
Signed-off-by: Yoshihiro Shimoda <[email protected]>
Signed-off-by: Ai Kyuse <[email protected]>
Signed-off-by: Simon Horman <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
dev_pm_ops are not supposed to change at runtime. All functions
working with dev_pm_ops provided by <linux/device.h> work with const
dev_pm_ops. So mark the non-const structs as const.
File size before:
text data bss dec hex filename
11586 624 0 12210 2fb2 drivers/mmc/host/omap_hsmmc.o
File size After adding 'const':
text data bss dec hex filename
11778 432 0 12210 2fb2 drivers/mmc/host/omap_hsmmc.o
Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
Commit 2a842acab109 ("block: introduce new block status code type") changed
the error type but not in patches merged through the mmc tree, like
commit 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver
op"). Fix one error code that is incorrect and also use BLK_STS_OK in
preference to 0.
Fixes: 17ece345a042 ("Merge tag 'mmc-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc")
Signed-off-by: Adrian Hunter <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|
|
We to some extent should tolerate R1_OUT_OF_RANGE for open-ending
mode as it is expected behaviour and most of the backup partition
tables should be located near some of the last blocks which will
always make open-ending read exceed the capacity of cards.
Fixes: 9820a5b11101 ("mmc: core: for data errors, take response of stop cmd into account")
Fixes: a04e6bae9e6f ("mmc: core: check also R1 response for stop commands")
Signed-off-by: Shawn Lin <[email protected]>
Reviewed-by: Wolfram Sang <[email protected]>
Tested-by: Shawn Guo <[email protected]>
Signed-off-by: Ulf Hansson <[email protected]>
|