On 17 June 2014 03:04, micky <micky_ching@xxxxxxxxxxxxxx> wrote:any other method?
On 06/16/2014 08:40 PM, Ulf Hansson wrote:Okay. Unless I missed your point, I don't think you need the work/workqueue.
On 16 June 2014 11:09, micky <micky_ching@xxxxxxxxxxxxxx> wrote:Yes.
On 06/16/2014 04:42 PM, Ulf Hansson wrote:ops->request should never executed in atomic context. Is that your
Hi Uffe,@@ -36,7 +37,10 @@ struct realtek_pci_sdmmc {I am trying to understand why you need a work/workqueue to implement
struct rtsx_pcr *pcr;
struct mmc_host *mmc;
struct mmc_request *mrq;
+ struct workqueue_struct *workq;
+#define SDMMC_WORKQ_NAME "rtsx_pci_sdmmc_workq"
+ struct work_struct work;
this feature. Is that really the case?
Could you elaborate on the reasons?
we need return as fast as possible in mmc_host_ops request(ops->request)
callback,
so the mmc core can continue handle next request.
when next request everything is ready, it will wait previous done(if not
done),
then call ops->request().
we can't use atomic context, because we use mutex_lock() to protect
concern?
Sorry, I don't understand here, how kicked?
Because, ops->request isn't ever executed in atomic context. That's
due to the mmc core, which handles the async mechanism, are waiting
for a completion variable in process context, before it invokes the
ops->request() callback.
That completion variable will be kicked, from your host driver, when
you invoke mmc_request_done(), .
Kind regards
Uffe
.
resource, and we have to hold the lock during handle request.Kind regards
So I use workq, we just queue a work and return in ops->request(),
The mmc core can continue without blocking at ops->request().
Best Regards.
micky.
Uffe
.