summaryrefslogtreecommitdiff
path: root/drivers/fims
diff options
context:
space:
mode:
authorRobert Hodaszi <robert.hodaszi@digi.com>2011-07-01 15:15:27 +0200
committerRobert Hodaszi <robert.hodaszi@digi.com>2011-07-01 15:36:47 +0200
commit4735c0ebd3fa1a82a3b6eb7d904da3a34fb972cc (patch)
treeed8e834a1891f3f5df3f61c2f41eeb346e25c20c /drivers/fims
parent8d324557ac3db8fce0f4d1e13fbce3b51f6c4a64 (diff)
fim sdio: fixed Vantive #38541, firmware reload code didn't work
Problem: The FIM-SDIO driver was compiled as a module. After the modprobe, the firmware stopped working, and after a card was plugged in, it crashed the whole system. Solution: The main problem was that an old FIM fimware was in the rootfs, and it couldn't communicate properly with the driver. But the firmware reload crashed the system, when it shouldn't do that. It was because the driver didn't pass the SDIO FIM firmware's name to the FIM layer. Signed-off-by: Robert Hodaszi <robert.hodaszi@digi.com>
Diffstat (limited to 'drivers/fims')
-rw-r--r--drivers/fims/sdio/fim_sdio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/fims/sdio/fim_sdio.c b/drivers/fims/sdio/fim_sdio.c
index 859c5cf43520..84bd7d96fd8b 100644
--- a/drivers/fims/sdio/fim_sdio.c
+++ b/drivers/fims/sdio/fim_sdio.c
@@ -372,10 +372,25 @@ static void fim_sd_restart_work_func(struct work_struct *work)
struct fim_sdio_t *port;
struct fim_driver *fim;
int ret;
+#if defined(MODULE)
+ const char *fwcode = NULL;
+ char fwname[FIM_SDIO_FW_LEN];
+#else
+ char *fwname = NULL;
+ const char *fwcode;
+#endif
port = container_of(work, struct fim_sdio_t, restart_work);
fim = &port->fim;
+#if defined(MODULE)
+ snprintf(fwname, FIM_SDIO_FW_LEN, FIM_SDIO_FW_FILE_PAT, fim->picnr);
+#else
+ fwcode = (fim->picnr == 0) ? FIM_SDIO_FW_CODE0 : FIM_SDIO_FW_CODE1;
+#endif
+ fim->fw_name = fwname;
+ fim->fw_code = fwcode;
+
printk_dbg("Going to restart the FIM%i\n", fim->picnr);
fim_disable_irq(&port->fim);