* [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size
@ 2016-06-16 9:23 Amitkumar Karwar
2016-06-16 9:23 ` [PATCH v4 2/2] mmc: sdio support external scatter gather list Amitkumar Karwar
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Amitkumar Karwar @ 2016-06-16 9:23 UTC (permalink / raw)
To: linux-wireless-u79uwXL29TY76Z2rM5mHXA
Cc: Nishant Sarmukadam, Wei-Ning Huang,
linux-mmc-u79uwXL29TY76Z2rM5mHXA, Cathy Luo, Xinming Hu,
Amitkumar Karwar
From: Xinming Hu <huxm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
sdio device drivers need be able to get the host supported max_segs
and max_seg_size, so that they know the buffer size to allocate while
utilizing the scatter/gather DMA buffer list.
This patch provides API for this purpose.
Signed-off-by: Xinming Hu <huxm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
Signed-off-by: Amitkumar Karwar <akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
---
v2: v2 was submitted with minor improvement like replacing BUG_ON() with WARN_ON()
v3: Addressed below review comments from Ulf Hansson
a) In v3, patch has been split into two separate patches.
b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs
c) Replaced WARN_ON() with proper error code when sg_ptr->length is invalid
d) Instead of duplicating the code in mmc_io_rw_extended(), extra bool parameter
has been added to this function and used it in new APIs for SG.
v4: Removed WARN_ON() calls in newly added APIs. It's gets called in probe handler.
Caller already takes care of it(Shawn Lin).
---
drivers/mmc/core/sdio_io.c | 21 +++++++++++++++++++++
.../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++---
include/linux/mmc/sdio_func.h | 3 +++
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 78cb4d5..b1ecacc 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -720,3 +720,24 @@ int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags)
return 0;
}
EXPORT_SYMBOL_GPL(sdio_set_host_pm_flags);
+
+/**
+ * sdio_get_host_max_seg_size - get host maximum segment size
+ * @func: SDIO function attached to host
+ */
+unsigned int sdio_get_host_max_seg_size(struct sdio_func *func)
+{
+ return func->card->host->max_seg_size;
+}
+EXPORT_SYMBOL_GPL(sdio_get_host_max_seg_size);
+
+/**
+ * sdio_get_host_max_seg_count - get host maximum segment count
+ * @func: SDIO function attached to host
+ */
+unsigned short sdio_get_host_max_seg_count(struct sdio_func *func)
+{
+ return func->card->host->max_segs;
+}
+EXPORT_SYMBOL_GPL(sdio_get_host_max_seg_count);
+
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
index c4b89d2..ba579f4 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
@@ -896,9 +896,9 @@ void brcmf_sdiod_sgtable_alloc(struct brcmf_sdio_dev *sdiodev)
max_blocks = min_t(uint, host->max_blk_count, 511u);
sdiodev->max_request_size = min_t(uint, host->max_req_size,
max_blocks * func->cur_blksize);
- sdiodev->max_segment_count = min_t(uint, host->max_segs,
- SG_MAX_SINGLE_ALLOC);
- sdiodev->max_segment_size = host->max_seg_size;
+ sdiodev->max_segment_count = min_t(uint, SG_MAX_SINGLE_ALLOC,
+ sdio_get_host_max_seg_count(func));
+ sdiodev->max_segment_size = sdio_get_host_max_seg_size(func);
if (!sdiodev->sg_support)
return;
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index aab032a..b2b91df 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -159,4 +159,7 @@ extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
+unsigned short sdio_get_host_max_seg_count(struct sdio_func *func);
+unsigned int sdio_get_host_max_seg_size(struct sdio_func *func);
+
#endif /* LINUX_MMC_SDIO_FUNC_H */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v4 2/2] mmc: sdio support external scatter gather list 2016-06-16 9:23 [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar @ 2016-06-16 9:23 ` Amitkumar Karwar 2016-08-09 10:16 ` [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar [not found] ` <1466069006-10757-1-git-send-email-akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> 2 siblings, 0 replies; 9+ messages in thread From: Amitkumar Karwar @ 2016-06-16 9:23 UTC (permalink / raw) To: linux-wireless Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc, Cathy Luo, Xinming Hu, Amitkumar Karwar From: Xinming Hu <huxm@marvell.com> Currently sdio device drivers need to prepare a big continuous physical memory for large data transfer. mmc stack will construct scatter/gather buffer list to make use of ADMA2. According to the sdio host controller specification version 4.00 chapter 1.13.2, sdio device drivers have the ability to construct scatter/gather DMA buffer list. In this way, they do not need to allocate big memory. This patch refactors current sdio command 53 wrapper mmc_io_rw_extended, so that it can accept external scatter/gather buffer list from its caller, such as the sdio device driver. This patch is very useful on some embedded systems where large memory allocation fails sometimes. It gives 10 to 15% better throughput performance compared to a case in which small single data transfers are done. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> --- drivers/mmc/core/sdio_io.c | 22 ++++++++++++++++-- drivers/mmc/core/sdio_ops.c | 53 +++++++++++++++++++++++++++++++++++++++---- drivers/mmc/core/sdio_ops.h | 3 ++- include/linux/mmc/sdio_func.h | 6 +++++ 4 files changed, 76 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c index b1ecacc..1433204 100644 --- a/drivers/mmc/core/sdio_io.c +++ b/drivers/mmc/core/sdio_io.c @@ -322,7 +322,7 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write, size = blocks * func->cur_blksize; ret = mmc_io_rw_extended(func->card, write, - func->num, addr, incr_addr, buf, + func->num, addr, incr_addr, false, buf, blocks, func->cur_blksize); if (ret) return ret; @@ -340,7 +340,7 @@ static int sdio_io_rw_ext_helper(struct sdio_func *func, int write, /* Indicate byte mode by setting "blocks" = 0 */ ret = mmc_io_rw_extended(func->card, write, func->num, addr, - incr_addr, buf, 0, size); + incr_addr, false, buf, 0, size); if (ret) return ret; @@ -504,6 +504,24 @@ int sdio_writesb(struct sdio_func *func, unsigned int addr, void *src, } EXPORT_SYMBOL_GPL(sdio_writesb); +int sdio_readsb_sg_enh(struct sdio_func *func, unsigned int addr, + struct sg_table *dst) +{ + return mmc_io_rw_extended(func->card, 0, func->num, + addr, 0, true, + dst, 0, func->cur_blksize); +} +EXPORT_SYMBOL_GPL(sdio_readsb_sg_enh); + +int sdio_writesb_sg_enh(struct sdio_func *func, unsigned int addr, + struct sg_table *src) +{ + return mmc_io_rw_extended(func->card, 1, func->num, + addr, 0, true, + src, 0, func->cur_blksize); +} +EXPORT_SYMBOL_GPL(sdio_writesb_sg_enh); + /** * sdio_readw - read a 16 bit integer from a SDIO function * @func: SDIO function to access diff --git a/drivers/mmc/core/sdio_ops.c b/drivers/mmc/core/sdio_ops.c index 34f6e80..bec3069 100644 --- a/drivers/mmc/core/sdio_ops.c +++ b/drivers/mmc/core/sdio_ops.c @@ -118,16 +118,39 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, return mmc_io_rw_direct_host(card->host, write, fn, addr, in, out); } +/** + * mmc_io_rw_extended - wrapper for sdio command 53 read/write operation + * @card: destination device for read/write + * @write: zero indcate read, non-zero indicate write. + * @fn: SDIO function to access + * @addr: address of (single byte) FIFO + * @incr_addr: set to 1 indicate read or write multiple bytes + of data to/from an IO register address that + increment by 1 after each operation. + * @sg_enhance: if set true, the caller of this function will + prepare scatter gather dma buffer list. + * @buf: buffer that contains the data to write. if sg_enhance + is set, it point to SG dma buffer list. + * @blocks: number of blocks of data transfer. + if set zero, indicate byte mode + if set non-zero, indicate block mode + if sg_enhance is set, this parameter will not be used. + * @blksz: block size for block mode data transfer. + * + */ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, - unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz) + unsigned int addr, int incr_addr, bool sg_enhance, + void *buf, unsigned int blocks, unsigned int blksz) { struct mmc_request mrq = {NULL}; struct mmc_command cmd = {0}; struct mmc_data data = {0}; struct scatterlist sg, *sg_ptr; struct sg_table sgtable; + struct sg_table *sgtable_external; unsigned int nents, left_size, i; unsigned int seg_size = card->host->max_seg_size; + unsigned int sg_blocks = 0; BUG_ON(!card); BUG_ON(fn > 7); @@ -145,16 +168,35 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, cmd.arg |= fn << 28; cmd.arg |= incr_addr ? 0x04000000 : 0x00000000; cmd.arg |= addr << 9; + cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC; + + data.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ; + data.blksz = blksz; + + if (sg_enhance) { + sgtable_external = buf; + + for_each_sg(sgtable_external->sgl, sg_ptr, + sgtable_external->nents, i) { + if (sg_ptr->length > card->host->max_seg_size) + return -EINVAL; + sg_blocks += DIV_ROUND_UP(sg_ptr->length, blksz); + } + + cmd.arg |= 0x08000000 | sg_blocks; + data.blocks = sg_blocks; + data.sg = sgtable_external->sgl; + data.sg_len = sgtable_external->nents; + goto mmc_data_req; + } + if (blocks == 0) cmd.arg |= (blksz == 512) ? 0 : blksz; /* byte mode */ else cmd.arg |= 0x08000000 | blocks; /* block mode */ - cmd.flags = MMC_RSP_SPI_R5 | MMC_RSP_R5 | MMC_CMD_ADTC; - data.blksz = blksz; /* Code in host drivers/fwk assumes that "blocks" always is >=1 */ data.blocks = blocks ? blocks : 1; - data.flags = write ? MMC_DATA_WRITE : MMC_DATA_READ; left_size = data.blksz * data.blocks; nents = (left_size - 1) / seg_size + 1; @@ -178,11 +220,12 @@ int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, sg_init_one(&sg, buf, left_size); } +mmc_data_req: mmc_set_data_timeout(&data, card); mmc_wait_for_req(card->host, &mrq); - if (nents > 1) + if (!sg_enhance && nents > 1) sg_free_table(&sgtable); if (cmd.error) diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h index 5660c7f..a8b8e0c 100644 --- a/drivers/mmc/core/sdio_ops.h +++ b/drivers/mmc/core/sdio_ops.h @@ -18,7 +18,8 @@ int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr); int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn, unsigned addr, u8 in, u8* out); int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn, - unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz); + unsigned int addr, int incr_addr, bool sg_enhance, + void *buf, unsigned int blocks, unsigned int blksz); int sdio_reset(struct mmc_host *host); static inline bool mmc_is_io_op(u32 opcode) diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index b2b91df..ba8f392 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h @@ -14,6 +14,7 @@ #include <linux/device.h> #include <linux/mod_devicetable.h> +#include <linux/scatterlist.h> #include <linux/mmc/pm.h> @@ -136,6 +137,11 @@ extern int sdio_memcpy_fromio(struct sdio_func *func, void *dst, extern int sdio_readsb(struct sdio_func *func, void *dst, unsigned int addr, int count); +int sdio_readsb_sg_enh(struct sdio_func *func, unsigned int addr, + struct sg_table *dst); +int sdio_writesb_sg_enh(struct sdio_func *func, unsigned int addr, + struct sg_table *src); + extern void sdio_writeb(struct sdio_func *func, u8 b, unsigned int addr, int *err_ret); extern void sdio_writew(struct sdio_func *func, u16 b, -- 1.9.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2016-06-16 9:23 [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar 2016-06-16 9:23 ` [PATCH v4 2/2] mmc: sdio support external scatter gather list Amitkumar Karwar @ 2016-08-09 10:16 ` Amitkumar Karwar 2017-11-16 13:57 ` Xinming Hu [not found] ` <1466069006-10757-1-git-send-email-akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> 2 siblings, 1 reply; 9+ messages in thread From: Amitkumar Karwar @ 2016-08-09 10:16 UTC (permalink / raw) To: Ulf Hansson Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Xinming Hu Hi Ulf, > From: Amitkumar Karwar [mailto:akarwar@marvell.com] > Sent: Thursday, June 16, 2016 2:53 PM > To: linux-wireless@vger.kernel.org > Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; Cathy > Luo; Xinming Hu; Amitkumar Karwar > Subject: [PATCH v4 1/2] mmc: API for accessing host supported maximum > segment count and size > > From: Xinming Hu <huxm@marvell.com> > > sdio device drivers need be able to get the host supported max_segs and > max_seg_size, so that they know the buffer size to allocate while > utilizing the scatter/gather DMA buffer list. > > This patch provides API for this purpose. > > Signed-off-by: Xinming Hu <huxm@marvell.com> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> > --- > v2: v2 was submitted with minor improvement like replacing BUG_ON() with > WARN_ON() > v3: Addressed below review comments from Ulf Hansson > a) In v3, patch has been split into two separate patches. > b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs > c) Replaced WARN_ON() with proper error code when sg_ptr->length is > invalid > d) Instead of duplicating the code in mmc_io_rw_extended(), extra > bool parameter > has been added to this function and used it in new APIs for SG. > v4: Removed WARN_ON() calls in newly added APIs. It's gets called in > probe handler. > Caller already takes care of it(Shawn Lin). > --- > drivers/mmc/core/sdio_io.c | 21 > +++++++++++++++++++++ > .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++--- > include/linux/mmc/sdio_func.h | 3 +++ > 3 files changed, 27 insertions(+), 3 deletions(-) > Please let me know if you have any further review comments for this patch series. Regards, Amitkumar ^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2016-08-09 10:16 ` [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar @ 2017-11-16 13:57 ` Xinming Hu 2017-11-21 11:44 ` Ulf Hansson 0 siblings, 1 reply; 9+ messages in thread From: Xinming Hu @ 2017-11-16 13:57 UTC (permalink / raw) To: Ulf Hansson Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Zhiyuan Yang, Tim Song, Xu (Shanghai) Wang, James Cao, Ganapathi Bhat Hi Ulf, Could you please let us know if you have any further review comments on this patch series. Regards, Simon > -----Original Message----- > From: Amitkumar Karwar > Sent: 2016年8月9日 18:16 > To: Ulf Hansson <ulf.hansson@linaro.org> > Cc: Nishant Sarmukadam <nishants@marvell.com>; Wei-Ning Huang > <wnhuang@chromium.org>; linux-mmc@vger.kernel.org; Cathy Luo > <cluo@marvell.com>; Xinming Hu <huxm@marvell.com> > Subject: RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum > segment count and size > > Hi Ulf, > > > From: Amitkumar Karwar [mailto:akarwar@marvell.com] > > Sent: Thursday, June 16, 2016 2:53 PM > > To: linux-wireless@vger.kernel.org > > Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; > > Cathy Luo; Xinming Hu; Amitkumar Karwar > > Subject: [PATCH v4 1/2] mmc: API for accessing host supported maximum > > segment count and size > > > > From: Xinming Hu <huxm@marvell.com> > > > > sdio device drivers need be able to get the host supported max_segs > > and max_seg_size, so that they know the buffer size to allocate while > > utilizing the scatter/gather DMA buffer list. > > > > This patch provides API for this purpose. > > > > Signed-off-by: Xinming Hu <huxm@marvell.com> > > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> > > --- > > v2: v2 was submitted with minor improvement like replacing BUG_ON() > > with > > WARN_ON() > > v3: Addressed below review comments from Ulf Hansson > > a) In v3, patch has been split into two separate patches. > > b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs > > c) Replaced WARN_ON() with proper error code when sg_ptr->length > > is invalid > > d) Instead of duplicating the code in mmc_io_rw_extended(), extra > > bool parameter > > has been added to this function and used it in new APIs for SG. > > v4: Removed WARN_ON() calls in newly added APIs. It's gets called in > > probe handler. > > Caller already takes care of it(Shawn Lin). > > --- > > drivers/mmc/core/sdio_io.c | 21 > > +++++++++++++++++++++ > > .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++--- > > include/linux/mmc/sdio_func.h | 3 +++ > > 3 files changed, 27 insertions(+), 3 deletions(-) > > > > Please let me know if you have any further review comments for this patch > series. > > Regards, > Amitkumar ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2017-11-16 13:57 ` Xinming Hu @ 2017-11-21 11:44 ` Ulf Hansson 2017-11-21 11:58 ` [EXT] " Xinming Hu 0 siblings, 1 reply; 9+ messages in thread From: Ulf Hansson @ 2017-11-21 11:44 UTC (permalink / raw) To: Xinming Hu Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Zhiyuan Yang, Tim Song, Xu (Shanghai) Wang, James Cao, Ganapathi Bhat On 16 November 2017 at 14:57, Xinming Hu <huxm@marvell.com> wrote: > Hi Ulf, > > Could you please let us know if you have any further review comments on this patch series. Seems like this fallen through the cracks. Would you mind re-posting a re-based series instead? In that way you hopefully get some more people's attention as well. Kind regards Uffe > > Regards, > Simon > >> -----Original Message----- >> From: Amitkumar Karwar >> Sent: 2016年8月9日 18:16 >> To: Ulf Hansson <ulf.hansson@linaro.org> >> Cc: Nishant Sarmukadam <nishants@marvell.com>; Wei-Ning Huang >> <wnhuang@chromium.org>; linux-mmc@vger.kernel.org; Cathy Luo >> <cluo@marvell.com>; Xinming Hu <huxm@marvell.com> >> Subject: RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum >> segment count and size >> >> Hi Ulf, >> >> > From: Amitkumar Karwar [mailto:akarwar@marvell.com] >> > Sent: Thursday, June 16, 2016 2:53 PM >> > To: linux-wireless@vger.kernel.org >> > Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; >> > Cathy Luo; Xinming Hu; Amitkumar Karwar >> > Subject: [PATCH v4 1/2] mmc: API for accessing host supported maximum >> > segment count and size >> > >> > From: Xinming Hu <huxm@marvell.com> >> > >> > sdio device drivers need be able to get the host supported max_segs >> > and max_seg_size, so that they know the buffer size to allocate while >> > utilizing the scatter/gather DMA buffer list. >> > >> > This patch provides API for this purpose. >> > >> > Signed-off-by: Xinming Hu <huxm@marvell.com> >> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> >> > --- >> > v2: v2 was submitted with minor improvement like replacing BUG_ON() >> > with >> > WARN_ON() >> > v3: Addressed below review comments from Ulf Hansson >> > a) In v3, patch has been split into two separate patches. >> > b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs >> > c) Replaced WARN_ON() with proper error code when sg_ptr->length >> > is invalid >> > d) Instead of duplicating the code in mmc_io_rw_extended(), extra >> > bool parameter >> > has been added to this function and used it in new APIs for SG. >> > v4: Removed WARN_ON() calls in newly added APIs. It's gets called in >> > probe handler. >> > Caller already takes care of it(Shawn Lin). >> > --- >> > drivers/mmc/core/sdio_io.c | 21 >> > +++++++++++++++++++++ >> > .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++--- >> > include/linux/mmc/sdio_func.h | 3 +++ >> > 3 files changed, 27 insertions(+), 3 deletions(-) >> > >> >> Please let me know if you have any further review comments for this patch >> series. >> >> Regards, >> Amitkumar ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [EXT] Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2017-11-21 11:44 ` Ulf Hansson @ 2017-11-21 11:58 ` Xinming Hu 2017-11-21 15:13 ` Ulf Hansson 0 siblings, 1 reply; 9+ messages in thread From: Xinming Hu @ 2017-11-21 11:58 UTC (permalink / raw) To: Ulf Hansson Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Zhiyuan Yang, Tim Song, Xu (Shanghai) Wang, James Cao, Ganapathi Bhat Hi Ulf, Would you mind re-posting a re-based series instead? In that way you hopefully get some more people's attention as well. >>> Sure. Could you please point the latest mmc git code base ? I guess it is https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/ But looks quite old. Regards, Simon ________________________________________ From: Ulf Hansson <ulf.hansson@linaro.org> Sent: Tuesday, November 21, 2017 19:44 To: Xinming Hu Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; Cathy Luo; Zhiyuan Yang; Tim Song; Xu (Shanghai) Wang; James Cao; Ganapathi Bhat Subject: [EXT] Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size External Email ---------------------------------------------------------------------- On 16 November 2017 at 14:57, Xinming Hu <huxm@marvell.com> wrote: > Hi Ulf, > > Could you please let us know if you have any further review comments on this patch series. Seems like this fallen through the cracks. Would you mind re-posting a re-based series instead? In that way you hopefully get some more people's attention as well. Kind regards Uffe > > Regards, > Simon > >> -----Original Message----- >> From: Amitkumar Karwar >> Sent: 2016年8月9日 18:16 >> To: Ulf Hansson <ulf.hansson@linaro.org> >> Cc: Nishant Sarmukadam <nishants@marvell.com>; Wei-Ning Huang >> <wnhuang@chromium.org>; linux-mmc@vger.kernel.org; Cathy Luo >> <cluo@marvell.com>; Xinming Hu <huxm@marvell.com> >> Subject: RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum >> segment count and size >> >> Hi Ulf, >> >> > From: Amitkumar Karwar [mailto:akarwar@marvell.com] >> > Sent: Thursday, June 16, 2016 2:53 PM >> > To: linux-wireless@vger.kernel.org >> > Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; >> > Cathy Luo; Xinming Hu; Amitkumar Karwar >> > Subject: [PATCH v4 1/2] mmc: API for accessing host supported maximum >> > segment count and size >> > >> > From: Xinming Hu <huxm@marvell.com> >> > >> > sdio device drivers need be able to get the host supported max_segs >> > and max_seg_size, so that they know the buffer size to allocate while >> > utilizing the scatter/gather DMA buffer list. >> > >> > This patch provides API for this purpose. >> > >> > Signed-off-by: Xinming Hu <huxm@marvell.com> >> > Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> >> > --- >> > v2: v2 was submitted with minor improvement like replacing BUG_ON() >> > with >> > WARN_ON() >> > v3: Addressed below review comments from Ulf Hansson >> > a) In v3, patch has been split into two separate patches. >> > b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs >> > c) Replaced WARN_ON() with proper error code when sg_ptr->length >> > is invalid >> > d) Instead of duplicating the code in mmc_io_rw_extended(), extra >> > bool parameter >> > has been added to this function and used it in new APIs for SG. >> > v4: Removed WARN_ON() calls in newly added APIs. It's gets called in >> > probe handler. >> > Caller already takes care of it(Shawn Lin). >> > --- >> > drivers/mmc/core/sdio_io.c | 21 >> > +++++++++++++++++++++ >> > .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++--- >> > include/linux/mmc/sdio_func.h | 3 +++ >> > 3 files changed, 27 insertions(+), 3 deletions(-) >> > >> >> Please let me know if you have any further review comments for this patch >> series. >> >> Regards, >> Amitkumar ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [EXT] Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2017-11-21 11:58 ` [EXT] " Xinming Hu @ 2017-11-21 15:13 ` Ulf Hansson 2017-11-22 1:58 ` Xinming Hu 0 siblings, 1 reply; 9+ messages in thread From: Ulf Hansson @ 2017-11-21 15:13 UTC (permalink / raw) To: Xinming Hu Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Zhiyuan Yang, Tim Song, Xu (Shanghai) Wang, James Cao, Ganapathi Bhat On 21 November 2017 at 12:58, Xinming Hu <huxm@marvell.com> wrote: > Hi Ulf, > > Would you mind re-posting a re-based series instead? In that way > you hopefully get some more people's attention as well. >>>> Sure. Could you please point the latest mmc git code base ? I guess it is > https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/ > But looks quite old. I am not using the master branch, but the next and fixes branch. Please have a look again. [...] Br Uffe ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [EXT] Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size 2017-11-21 15:13 ` Ulf Hansson @ 2017-11-22 1:58 ` Xinming Hu 0 siblings, 0 replies; 9+ messages in thread From: Xinming Hu @ 2017-11-22 1:58 UTC (permalink / raw) To: Ulf Hansson Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc@vger.kernel.org, Cathy Luo, Zhiyuan Yang, Tim Song, Xu (Shanghai) Wang, James Cao, Ganapathi Bhat, Bob Tan Hi Ulf, I am not using the master branch, but the next and fixes branch. Please have a look again. >>> Got it, Thanks. Regards, Simon _______________________________________ From: Ulf Hansson <ulf.hansson@linaro.org> Sent: Tuesday, November 21, 2017 23:13 To: Xinming Hu Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc@vger.kernel.org; Cathy Luo; Zhiyuan Yang; Tim Song; Xu (Shanghai) Wang; James Cao; Ganapathi Bhat Subject: Re: [EXT] Re: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size On 21 November 2017 at 12:58, Xinming Hu <huxm@marvell.com> wrote: > Hi Ulf, > > Would you mind re-posting a re-based series instead? In that way > you hopefully get some more people's attention as well. >>>> Sure. Could you please point the latest mmc git code base ? I guess it is > https://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git/ > But looks quite old. I am not using the master branch, but the next and fixes branch. Please have a look again. [...] Br Uffe ^ permalink raw reply [flat|nested] 9+ messages in thread
[parent not found: <1466069006-10757-1-git-send-email-akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>]
* RE: [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size [not found] ` <1466069006-10757-1-git-send-email-akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> @ 2016-12-22 9:09 ` Amitkumar Karwar 0 siblings, 0 replies; 9+ messages in thread From: Amitkumar Karwar @ 2016-12-22 9:09 UTC (permalink / raw) To: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Ulf Hansson Cc: Nishant Sarmukadam, Wei-Ning Huang, linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Cathy Luo, Xinming Hu Hi Ulf, > From: Amitkumar Karwar [mailto:akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org] > Sent: Thursday, June 16, 2016 2:53 PM > To: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > Cc: Nishant Sarmukadam; Wei-Ning Huang; linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; > Cathy Luo; Xinming Hu; Amitkumar Karwar > Subject: [PATCH v4 1/2] mmc: API for accessing host supported maximum > segment count and size > > From: Xinming Hu <huxm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> > > sdio device drivers need be able to get the host supported max_segs and > max_seg_size, so that they know the buffer size to allocate while > utilizing the scatter/gather DMA buffer list. > > This patch provides API for this purpose. > > Signed-off-by: Xinming Hu <huxm-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> > Signed-off-by: Amitkumar Karwar <akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org> > --- > v2: v2 was submitted with minor improvement like replacing BUG_ON() > with WARN_ON() > v3: Addressed below review comments from Ulf Hansson > a) In v3, patch has been split into two separate patches. > b) Patch 1/2 introduces an API to fetch max_seg_size and max_segs > c) Replaced WARN_ON() with proper error code when sg_ptr->length is > invalid > d) Instead of duplicating the code in mmc_io_rw_extended(), extra > bool parameter > has been added to this function and used it in new APIs for SG. > v4: Removed WARN_ON() calls in newly added APIs. It's gets called in > probe handler. > Caller already takes care of it(Shawn Lin). > --- > drivers/mmc/core/sdio_io.c | 21 > +++++++++++++++++++++ > .../wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 6 +++--- > include/linux/mmc/sdio_func.h | 3 +++ > 3 files changed, 27 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c > index 78cb4d5..b1ecacc 100644 > --- a/drivers/mmc/core/sdio_io.c > +++ b/drivers/mmc/core/sdio_io.c > @@ -720,3 +720,24 @@ int sdio_set_host_pm_flags(struct sdio_func *func, > mmc_pm_flag_t flags) > return 0; > } > EXPORT_SYMBOL_GPL(sdio_set_host_pm_flags); > + > +/** > + * sdio_get_host_max_seg_size - get host maximum segment size > + * @func: SDIO function attached to host > + */ > +unsigned int sdio_get_host_max_seg_size(struct sdio_func *func) { > + return func->card->host->max_seg_size; } > +EXPORT_SYMBOL_GPL(sdio_get_host_max_seg_size); > + > +/** > + * sdio_get_host_max_seg_count - get host maximum segment count > + * @func: SDIO function attached to host > + */ > +unsigned short sdio_get_host_max_seg_count(struct sdio_func *func) { > + return func->card->host->max_segs; > +} > +EXPORT_SYMBOL_GPL(sdio_get_host_max_seg_count); > + > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > index c4b89d2..ba579f4 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c > @@ -896,9 +896,9 @@ void brcmf_sdiod_sgtable_alloc(struct > brcmf_sdio_dev *sdiodev) > max_blocks = min_t(uint, host->max_blk_count, 511u); > sdiodev->max_request_size = min_t(uint, host->max_req_size, > max_blocks * func->cur_blksize); > - sdiodev->max_segment_count = min_t(uint, host->max_segs, > - SG_MAX_SINGLE_ALLOC); > - sdiodev->max_segment_size = host->max_seg_size; > + sdiodev->max_segment_count = min_t(uint, SG_MAX_SINGLE_ALLOC, > + sdio_get_host_max_seg_count(func)); > + sdiodev->max_segment_size = sdio_get_host_max_seg_size(func); > > if (!sdiodev->sg_support) > return; > diff --git a/include/linux/mmc/sdio_func.h > b/include/linux/mmc/sdio_func.h index aab032a..b2b91df 100644 > --- a/include/linux/mmc/sdio_func.h > +++ b/include/linux/mmc/sdio_func.h > @@ -159,4 +159,7 @@ extern void sdio_f0_writeb(struct sdio_func *func, > unsigned char b, extern mmc_pm_flag_t sdio_get_host_pm_caps(struct > sdio_func *func); extern int sdio_set_host_pm_flags(struct sdio_func > *func, mmc_pm_flag_t flags); > > +unsigned short sdio_get_host_max_seg_count(struct sdio_func *func); > +unsigned int sdio_get_host_max_seg_size(struct sdio_func *func); > + > #endif /* LINUX_MMC_SDIO_FUNC_H */ This has been pending for a while. Any further review comments on this v4 patch series? Regards, Amitkumar Karwar ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-11-22 1:58 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 9:23 [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar
2016-06-16 9:23 ` [PATCH v4 2/2] mmc: sdio support external scatter gather list Amitkumar Karwar
2016-08-09 10:16 ` [PATCH v4 1/2] mmc: API for accessing host supported maximum segment count and size Amitkumar Karwar
2017-11-16 13:57 ` Xinming Hu
2017-11-21 11:44 ` Ulf Hansson
2017-11-21 11:58 ` [EXT] " Xinming Hu
2017-11-21 15:13 ` Ulf Hansson
2017-11-22 1:58 ` Xinming Hu
[not found] ` <1466069006-10757-1-git-send-email-akarwar-eYqpPyKDWXRBDgjK7y7TUQ@public.gmane.org>
2016-12-22 9:09 ` Amitkumar Karwar
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox