All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device
@ 2015-03-17 11:09 Chuanxiao Dong
  2015-04-02  8:57 ` Alex Lemberg
  0 siblings, 1 reply; 5+ messages in thread
From: Chuanxiao Dong @ 2015-03-17 11:09 UTC (permalink / raw)
  To: linux-mmc

Hello

This serial of patches can implement the eMMC5.1 device command queue feature
even a host controller doesn't support CMDQ. Several weeks ago I submitted RFC
patches for review and collected some review comments. Right now these comments
are fixed thus I submit again as the offical patches. Please have a review.

Chuanxiao Dong (5):
  mmc: replace sbc to precmd and add postcmd
  mmc: host: add runtime PM for host class dev
  mmc: queue: change mqrq_cur and mqrq_pre to mq qdepth
  mmc: core: add support for CMDQ feature in MMC Core stack
  mmc: sdhci: add SW CMDQ support for SDHCI host

 drivers/mmc/card/block.c      |  538 ++++++++++++++++++++++++++++++++++++++---
 drivers/mmc/card/queue.c      |  213 ++++++++--------
 drivers/mmc/card/queue.h      |   14 +-
 drivers/mmc/core/core.c       |   85 ++++++-
 drivers/mmc/core/host.c       |   13 +
 drivers/mmc/core/mmc.c        |   37 ++-
 drivers/mmc/host/dw_mmc.c     |    8 +-
 drivers/mmc/host/mmci.c       |   14 +-
 drivers/mmc/host/omap_hsmmc.c |   18 +-
 drivers/mmc/host/sdhci-acpi.c |    1 -
 drivers/mmc/host/sdhci-pci.c  |    1 -
 drivers/mmc/host/sdhci.c      |  137 +++++++++--
 drivers/mmc/host/sdhci.h      |    1 +
 include/linux/mmc/card.h      |    3 +
 include/linux/mmc/core.h      |    5 +-
 include/linux/mmc/host.h      |    5 +
 include/linux/mmc/mmc.h       |   21 ++
 include/linux/mmc/pm.h        |    1 +
 18 files changed, 911 insertions(+), 204 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device
  2015-03-17 11:09 [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device Chuanxiao Dong
@ 2015-04-02  8:57 ` Alex Lemberg
  2015-04-02 10:52   ` Dong, Chuanxiao
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Lemberg @ 2015-04-02  8:57 UTC (permalink / raw)
  To: Chuanxiao Dong, linux-mmc; +Cc: Yuliy Izrailov

Hi Chuanxiao,


> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Chuanxiao Dong
> Sent: Tuesday, March 17, 2015 1:10 PM
> To: linux-mmc@vger.kernel.org
> Subject: [PATCH 0/5] mmc: Soft Command queue implementation for
> eMMC5.1 device
> 
> Hello
> 
> This serial of patches can implement the eMMC5.1 device command queue
> feature even a host controller doesn't support CMDQ. Several weeks ago I
> submitted RFC patches for review and collected some review comments. Right
> now these comments are fixed thus I submit again as the offical patches. Please
> have a review.

Thanks for sending the new patch. 
We have reviewed and see issues still exists like in previous patch version.
The driver flow where request with the same TID is executed right after completing
its data transfer, is still possible.
We suspect that the new solution is not covering the case of driver thread context switch,
Specifically the following condition in block.c:

+			if (host->areq == areq)
+				goto next;


Thanks,
Alex

> 
> Chuanxiao Dong (5):
>   mmc: replace sbc to precmd and add postcmd
>   mmc: host: add runtime PM for host class dev
>   mmc: queue: change mqrq_cur and mqrq_pre to mq qdepth
>   mmc: core: add support for CMDQ feature in MMC Core stack
>   mmc: sdhci: add SW CMDQ support for SDHCI host
> 
>  drivers/mmc/card/block.c      |  538
> ++++++++++++++++++++++++++++++++++++++---
>  drivers/mmc/card/queue.c      |  213 ++++++++--------
>  drivers/mmc/card/queue.h      |   14 +-
>  drivers/mmc/core/core.c       |   85 ++++++-
>  drivers/mmc/core/host.c       |   13 +
>  drivers/mmc/core/mmc.c        |   37 ++-
>  drivers/mmc/host/dw_mmc.c     |    8 +-
>  drivers/mmc/host/mmci.c       |   14 +-
>  drivers/mmc/host/omap_hsmmc.c |   18 +-
>  drivers/mmc/host/sdhci-acpi.c |    1 -
>  drivers/mmc/host/sdhci-pci.c  |    1 -
>  drivers/mmc/host/sdhci.c      |  137 +++++++++--
>  drivers/mmc/host/sdhci.h      |    1 +
>  include/linux/mmc/card.h      |    3 +
>  include/linux/mmc/core.h      |    5 +-
>  include/linux/mmc/host.h      |    5 +
>  include/linux/mmc/mmc.h       |   21 ++
>  include/linux/mmc/pm.h        |    1 +
>  18 files changed, 911 insertions(+), 204 deletions(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device
  2015-04-02  8:57 ` Alex Lemberg
@ 2015-04-02 10:52   ` Dong, Chuanxiao
  2015-04-06 13:47     ` Alex Lemberg
  0 siblings, 1 reply; 5+ messages in thread
From: Dong, Chuanxiao @ 2015-04-02 10:52 UTC (permalink / raw)
  To: Alex Lemberg, linux-mmc; +Cc: Yuliy Izrailov

Thanks Alex for review.

>From my understanding, if host->areq == areq, then means the areq is the current running request. By this way, driver will clear the executable ready bit in slots and continue to find the next one. So the task with the same ID won't be executed at the same time.

+	do {
+		id = find_first_bit(&slots, mq->qdepth);
+		if (id < mq->qdepth) {
+			areq = &mq->mqrq[id].mmc_active;
+			if (host->areq == areq)
+				goto next;
.....
......
+next:
+		__clear_bit(id, &slots);
+	} while (status);

I also prepared patch set v1, which won't send CMD13 to poll cmdq ready during a cmdq request is executing by CMD46/47. Will send them out later.

Thanks
Chuanxiao

> -----Original Message-----
> From: Alex Lemberg [mailto:Alex.Lemberg@sandisk.com]
> Sent: Thursday, April 02, 2015 4:57 PM
> To: Dong, Chuanxiao; linux-mmc@vger.kernel.org
> Cc: Yuliy Izrailov
> Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> eMMC5.1 device
> 
> Hi Chuanxiao,
> 
> 
> > -----Original Message-----
> > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > owner@vger.kernel.org] On Behalf Of Chuanxiao Dong
> > Sent: Tuesday, March 17, 2015 1:10 PM
> > To: linux-mmc@vger.kernel.org
> > Subject: [PATCH 0/5] mmc: Soft Command queue implementation for
> > eMMC5.1 device
> >
> > Hello
> >
> > This serial of patches can implement the eMMC5.1 device command queue
> > feature even a host controller doesn't support CMDQ. Several weeks ago
> > I submitted RFC patches for review and collected some review comments.
> > Right now these comments are fixed thus I submit again as the offical
> > patches. Please have a review.
> 
> Thanks for sending the new patch.
> We have reviewed and see issues still exists like in previous patch version.
> The driver flow where request with the same TID is executed right after
> completing its data transfer, is still possible.
> We suspect that the new solution is not covering the case of driver thread
> context switch, Specifically the following condition in block.c:
> 
> +			if (host->areq == areq)
> +				goto next;
> 
> 
> Thanks,
> Alex
> 
> >
> > Chuanxiao Dong (5):
> >   mmc: replace sbc to precmd and add postcmd
> >   mmc: host: add runtime PM for host class dev
> >   mmc: queue: change mqrq_cur and mqrq_pre to mq qdepth
> >   mmc: core: add support for CMDQ feature in MMC Core stack
> >   mmc: sdhci: add SW CMDQ support for SDHCI host
> >
> >  drivers/mmc/card/block.c      |  538
> > ++++++++++++++++++++++++++++++++++++++---
> >  drivers/mmc/card/queue.c      |  213 ++++++++--------
> >  drivers/mmc/card/queue.h      |   14 +-
> >  drivers/mmc/core/core.c       |   85 ++++++-
> >  drivers/mmc/core/host.c       |   13 +
> >  drivers/mmc/core/mmc.c        |   37 ++-
> >  drivers/mmc/host/dw_mmc.c     |    8 +-
> >  drivers/mmc/host/mmci.c       |   14 +-
> >  drivers/mmc/host/omap_hsmmc.c |   18 +-
> >  drivers/mmc/host/sdhci-acpi.c |    1 -
> >  drivers/mmc/host/sdhci-pci.c  |    1 -
> >  drivers/mmc/host/sdhci.c      |  137 +++++++++--
> >  drivers/mmc/host/sdhci.h      |    1 +
> >  include/linux/mmc/card.h      |    3 +
> >  include/linux/mmc/core.h      |    5 +-
> >  include/linux/mmc/host.h      |    5 +
> >  include/linux/mmc/mmc.h       |   21 ++
> >  include/linux/mmc/pm.h        |    1 +
> >  18 files changed, 911 insertions(+), 204 deletions(-)
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > in the body of a message to majordomo@vger.kernel.org More majordomo
> > info at http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device
  2015-04-02 10:52   ` Dong, Chuanxiao
@ 2015-04-06 13:47     ` Alex Lemberg
  2015-04-07  2:48       ` Dong, Chuanxiao
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Lemberg @ 2015-04-06 13:47 UTC (permalink / raw)
  To: Dong, Chuanxiao, linux-mmc; +Cc: Yuliy Izrailov

Hi Chuanxiao,


> -----Original Message-----
> From: Dong, Chuanxiao [mailto:chuanxiao.dong@intel.com]
> Sent: Thursday, April 02, 2015 1:52 PM
> To: Alex Lemberg; linux-mmc@vger.kernel.org
> Cc: Yuliy Izrailov
> Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> eMMC5.1 device
> 
> Thanks Alex for review.
> 
> From my understanding, if host->areq == areq, then means the areq is the
> current running request. By this way, driver will clear the executable ready bit
> in slots and continue to find the next one. So the task with the same ID won't be
> executed at the same time.

Right, but there is a case for context switch:

> 
> +	do {
> +		id = find_first_bit(&slots, mq->qdepth);
> +		if (id < mq->qdepth) {
> +			areq = &mq->mqrq[id].mmc_active;

What if host->areq will be changed as the result of completion interrupt,
in parallel or just before this if condition?

> +			if (host->areq == areq)
> +				goto next;
> .....
> ......
> +next:
> +		__clear_bit(id, &slots);
> +	} while (status);
> 
> I also prepared patch set v1, which won't send CMD13 to poll cmdq ready
> during a cmdq request is executing by CMD46/47. Will send them out later.
> 
> Thanks
> Chuanxiao
> 
> > -----Original Message-----
> > From: Alex Lemberg [mailto:Alex.Lemberg@sandisk.com]
> > Sent: Thursday, April 02, 2015 4:57 PM
> > To: Dong, Chuanxiao; linux-mmc@vger.kernel.org
> > Cc: Yuliy Izrailov
> > Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> > eMMC5.1 device
> >
> > Hi Chuanxiao,
> >
> >
> > > -----Original Message-----
> > > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > > owner@vger.kernel.org] On Behalf Of Chuanxiao Dong
> > > Sent: Tuesday, March 17, 2015 1:10 PM
> > > To: linux-mmc@vger.kernel.org
> > > Subject: [PATCH 0/5] mmc: Soft Command queue implementation for
> > > eMMC5.1 device
> > >
> > > Hello
> > >
> > > This serial of patches can implement the eMMC5.1 device command
> > > queue feature even a host controller doesn't support CMDQ. Several
> > > weeks ago I submitted RFC patches for review and collected some review
> comments.
> > > Right now these comments are fixed thus I submit again as the
> > > offical patches. Please have a review.
> >
> > Thanks for sending the new patch.
> > We have reviewed and see issues still exists like in previous patch version.
> > The driver flow where request with the same TID is executed right
> > after completing its data transfer, is still possible.
> > We suspect that the new solution is not covering the case of driver
> > thread context switch, Specifically the following condition in block.c:
> >
> > +			if (host->areq == areq)
> > +				goto next;
> >
> >
> > Thanks,
> > Alex
> >
> > >
> > > Chuanxiao Dong (5):
> > >   mmc: replace sbc to precmd and add postcmd
> > >   mmc: host: add runtime PM for host class dev
> > >   mmc: queue: change mqrq_cur and mqrq_pre to mq qdepth
> > >   mmc: core: add support for CMDQ feature in MMC Core stack
> > >   mmc: sdhci: add SW CMDQ support for SDHCI host
> > >
> > >  drivers/mmc/card/block.c      |  538
> > > ++++++++++++++++++++++++++++++++++++++---
> > >  drivers/mmc/card/queue.c      |  213 ++++++++--------
> > >  drivers/mmc/card/queue.h      |   14 +-
> > >  drivers/mmc/core/core.c       |   85 ++++++-
> > >  drivers/mmc/core/host.c       |   13 +
> > >  drivers/mmc/core/mmc.c        |   37 ++-
> > >  drivers/mmc/host/dw_mmc.c     |    8 +-
> > >  drivers/mmc/host/mmci.c       |   14 +-
> > >  drivers/mmc/host/omap_hsmmc.c |   18 +-
> > >  drivers/mmc/host/sdhci-acpi.c |    1 -
> > >  drivers/mmc/host/sdhci-pci.c  |    1 -
> > >  drivers/mmc/host/sdhci.c      |  137 +++++++++--
> > >  drivers/mmc/host/sdhci.h      |    1 +
> > >  include/linux/mmc/card.h      |    3 +
> > >  include/linux/mmc/core.h      |    5 +-
> > >  include/linux/mmc/host.h      |    5 +
> > >  include/linux/mmc/mmc.h       |   21 ++
> > >  include/linux/mmc/pm.h        |    1 +
> > >  18 files changed, 911 insertions(+), 204 deletions(-)
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > > in the body of a message to majordomo@vger.kernel.org More majordomo
> > > info at http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device
  2015-04-06 13:47     ` Alex Lemberg
@ 2015-04-07  2:48       ` Dong, Chuanxiao
  0 siblings, 0 replies; 5+ messages in thread
From: Dong, Chuanxiao @ 2015-04-07  2:48 UTC (permalink / raw)
  To: Alex Lemberg, linux-mmc; +Cc: Yuliy Izrailov

Hi Alex,

> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org
> [mailto:linux-mmc-owner@vger.kernel.org] On Behalf Of Alex Lemberg
> Sent: Monday, April 06, 2015 9:48 PM
> To: Dong, Chuanxiao; linux-mmc@vger.kernel.org
> Cc: Yuliy Izrailov
> Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> eMMC5.1 device
> 
> Hi Chuanxiao,
> 
> 
> > -----Original Message-----
> > From: Dong, Chuanxiao [mailto:chuanxiao.dong@intel.com]
> > Sent: Thursday, April 02, 2015 1:52 PM
> > To: Alex Lemberg; linux-mmc@vger.kernel.org
> > Cc: Yuliy Izrailov
> > Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> > eMMC5.1 device
> >
> > Thanks Alex for review.
> >
> > From my understanding, if host->areq == areq, then means the areq is
> > the current running request. By this way, driver will clear the
> > executable ready bit in slots and continue to find the next one. So
> > the task with the same ID won't be executed at the same time.
> 
> Right, but there is a case for context switch:
> 
> >
> > +	do {
> > +		id = find_first_bit(&slots, mq->qdepth);
> > +		if (id < mq->qdepth) {
> > +			areq = &mq->mqrq[id].mmc_active;
> 
> What if host->areq will be changed as the result of completion interrupt, in
> parallel or just before this if condition?
Host->areq will be changed after this "if", in function "mmc_execute_cmdq".They are synchronize. Except "mmc_execute_cmdq", host->areq is changed nowhere.

Thanks
Chuanxiao

> 
> > +			if (host->areq == areq)
> > +				goto next;
> > .....
> > ......
> > +next:
> > +		__clear_bit(id, &slots);
> > +	} while (status);
> >
> > I also prepared patch set v1, which won't send CMD13 to poll cmdq
> > ready during a cmdq request is executing by CMD46/47. Will send them out
> later.
> >
> > Thanks
> > Chuanxiao
> >
> > > -----Original Message-----
> > > From: Alex Lemberg [mailto:Alex.Lemberg@sandisk.com]
> > > Sent: Thursday, April 02, 2015 4:57 PM
> > > To: Dong, Chuanxiao; linux-mmc@vger.kernel.org
> > > Cc: Yuliy Izrailov
> > > Subject: RE: [PATCH 0/5] mmc: Soft Command queue implementation for
> > > eMMC5.1 device
> > >
> > > Hi Chuanxiao,
> > >
> > >
> > > > -----Original Message-----
> > > > From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> > > > owner@vger.kernel.org] On Behalf Of Chuanxiao Dong
> > > > Sent: Tuesday, March 17, 2015 1:10 PM
> > > > To: linux-mmc@vger.kernel.org
> > > > Subject: [PATCH 0/5] mmc: Soft Command queue implementation for
> > > > eMMC5.1 device
> > > >
> > > > Hello
> > > >
> > > > This serial of patches can implement the eMMC5.1 device command
> > > > queue feature even a host controller doesn't support CMDQ. Several
> > > > weeks ago I submitted RFC patches for review and collected some
> > > > review
> > comments.
> > > > Right now these comments are fixed thus I submit again as the
> > > > offical patches. Please have a review.
> > >
> > > Thanks for sending the new patch.
> > > We have reviewed and see issues still exists like in previous patch version.
> > > The driver flow where request with the same TID is executed right
> > > after completing its data transfer, is still possible.
> > > We suspect that the new solution is not covering the case of driver
> > > thread context switch, Specifically the following condition in block.c:
> > >
> > > +			if (host->areq == areq)
> > > +				goto next;
> > >
> > >
> > > Thanks,
> > > Alex
> > >
> > > >
> > > > Chuanxiao Dong (5):
> > > >   mmc: replace sbc to precmd and add postcmd
> > > >   mmc: host: add runtime PM for host class dev
> > > >   mmc: queue: change mqrq_cur and mqrq_pre to mq qdepth
> > > >   mmc: core: add support for CMDQ feature in MMC Core stack
> > > >   mmc: sdhci: add SW CMDQ support for SDHCI host
> > > >
> > > >  drivers/mmc/card/block.c      |  538
> > > > ++++++++++++++++++++++++++++++++++++++---
> > > >  drivers/mmc/card/queue.c      |  213 ++++++++--------
> > > >  drivers/mmc/card/queue.h      |   14 +-
> > > >  drivers/mmc/core/core.c       |   85 ++++++-
> > > >  drivers/mmc/core/host.c       |   13 +
> > > >  drivers/mmc/core/mmc.c        |   37 ++-
> > > >  drivers/mmc/host/dw_mmc.c     |    8 +-
> > > >  drivers/mmc/host/mmci.c       |   14 +-
> > > >  drivers/mmc/host/omap_hsmmc.c |   18 +-
> > > >  drivers/mmc/host/sdhci-acpi.c |    1 -
> > > >  drivers/mmc/host/sdhci-pci.c  |    1 -
> > > >  drivers/mmc/host/sdhci.c      |  137 +++++++++--
> > > >  drivers/mmc/host/sdhci.h      |    1 +
> > > >  include/linux/mmc/card.h      |    3 +
> > > >  include/linux/mmc/core.h      |    5 +-
> > > >  include/linux/mmc/host.h      |    5 +
> > > >  include/linux/mmc/mmc.h       |   21 ++
> > > >  include/linux/mmc/pm.h        |    1 +
> > > >  18 files changed, 911 insertions(+), 204 deletions(-)
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-mmc"
> > > > in the body of a message to majordomo@vger.kernel.org More
> > > > majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body
> of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-04-07  2:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 11:09 [PATCH 0/5] mmc: Soft Command queue implementation for eMMC5.1 device Chuanxiao Dong
2015-04-02  8:57 ` Alex Lemberg
2015-04-02 10:52   ` Dong, Chuanxiao
2015-04-06 13:47     ` Alex Lemberg
2015-04-07  2:48       ` Dong, Chuanxiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.