[PATCH V4 14/16] scsi: ppa: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 16/16] NCR5380: Support chained sg lists

2019-06-16 Thread Ming Lei
From: Finn Thain My understanding is that support for chained scatterlists is to become mandatory for LLDs. Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocate

[PATCH V4 15/16] scsi: wd33c93: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 13/16] scsi: pcmcia: nsp_cs: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 12/16] scsi: imm: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 11/16] scsi: aha152x: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
place SCp.buffers_residual with sg_is_last() for fixing updating it, and the similar change has been applied on NCR5380.c Cc: Finn Thain Signed-off-by: Ming Lei --- drivers/scsi/aha152x.c | 42 -- 1 file changed, 20 insertions(+), 22 deletions(-) diff --

[PATCH V4 10/16] s390: zfcp_fc: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
jamin Block Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux-s...@vger.kernel.org Acked-by: Benjamin Block Signed-off-by: Ming Lei --- drivers/s390/scsi/zfcp_fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c

[PATCH V4 09/16] staging: rtsx: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
c: de...@driverdev.osuosl.org Cc: Greg Kroah-Hartman Signed-off-by: Ming Lei --- drivers/staging/rts5208/rtsx_transport.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/rtsx_transport.c b/drivers/staging/rts5208/rtsx_transport.c index 8277d7895608..407c907

[PATCH V4 08/16] staging: unisys: visorhba: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
rg Cc: Greg Kroah-Hartman Acked-by: Greg Kroah-Hartman Signed-off-by: Ming Lei --- drivers/staging/unisys/visorhba/visorhba_main.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/vis

[PATCH V4 06/16] scsi: pmcraid: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 05/16] scsi: ipr: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Use the scatterlist iterators and remove direct indexing of the scatterlist array. This way allows us to pre-allocate one small scatterlist, which can be chained with one runtime allocated scatterlist if the pre-allocated one isn't enough for the whole request. Signed-off-by: Min

[PATCH V4 07/16] usb: image: microtek: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Ming Lei --- drivers/usb/image/microtek.c | 20 drivers/usb/image/microtek.h | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/usb/image/microtek.c b/drivers/usb/image/microtek.c

[PATCH V4 02/16] scsi: advansys: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
igned-off-by: Ming Lei --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index d37584403c33..b87de8d3d844 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -7714,7 +7

[PATCH V4 01/16] scsi: vmw_pscsi: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
igned-off-by: Ming Lei --- drivers/scsi/vmw_pvscsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index ecee4b3ff073..d71abd416eb4 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c @@ -335,7 +

[PATCH V4 03/16] scsi: lpfc: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
igned-off-by: Ming Lei --- drivers/scsi/lpfc/lpfc_nvmet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c index f3d9a5545164..3f803982bd1e 100644 --- a/drivers/scsi/lpfc/lpfc_nvmet.c +++ b/drivers/scsi

[PATCH V4 04/16] scsi: mvumi: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
igned-off-by: Ming Lei --- drivers/scsi/mvumi.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mvumi.c b/drivers/scsi/mvumi.c index a5410615edac..0022cd31500a 100644 --- a/drivers/scsi/mvumi.c +++ b/drivers/scsi/mvumi.c @@ -211,8 +211,7 @@ stati

[PATCH V4 00/16] use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
of words are from James Bottomley V2: - use coccinelle semantic patch for finding direct sgl uses from scsi command(9 drivers found) - run 'git grep -E "SCp.buffer"' to find direct sgl uses from SCp.buffer(6 drivers are found) Finn Thain (1

Re: [PATCH V3 10/15] scsi: aha152x: use sg helper to operate scatterlist

2019-06-16 Thread Ming Lei
On Fri, Jun 14, 2019 at 08:36:38PM +1000, Finn Thain wrote: > On Fri, 14 Jun 2019, Ming Lei wrote: > > > > > Follows the fixed version, could you review again? > > > > From f03484d4bac083c39d70665cfbadb641093b63de Mon Sep 17 00:00:00 2001 > > From: Ming Lei

Re: [PATCH v2] scsi: sd: block: Fix regressions in read-only block device handling

2019-02-18 Thread Ming Lei
lash drive. If it is true, this particular issue might be addressed simply by applying one quirk on this drive, such as, by adding one delay before calling sd_spinup_disk() in the 1st sd_revalidate_disk() to wait until it is ready to process I/O requests. Otherwise if there are many such devices, I think your approach is good. Thanks, Ming Lei

Re: [RFC PATCH 0/2] usb: dwc2: Enable URB giveback in a tasklet context

2014-09-15 Thread Ming Lei
On Tue, Sep 16, 2014 at 7:16 AM, Paul Zimmerman wrote: >> From: dingu...@opensource.altera.com [mailto:dingu...@opensource.altera.com] >> Sent: Monday, September 15, 2014 8:23 AM >> >> Hi Ming-Lei, >> >> Thanks for your patch to enable the URB giveback in a ta

Re: [RFC PATCH 0/2] usb: dwc2: Enable URB giveback in a tasklet context

2014-09-15 Thread Ming Lei
On Mon, Sep 15, 2014 at 11:22 PM, wrote: > From: Dinh Nguyen > > Hi Ming-Lei, > > Thanks for your patch to enable the URB giveback in a tasklet context for > the EHCI driver. I found your patch to fix a USB webcam timeout/stutter > issue on the DWC2 HCD in the SOCFPGA pla

Re: questions about give back urb in tasklet

2014-03-22 Thread Ming Lei
On Wed, Mar 19, 2014 at 11:05 PM, vichy wrote: > hi Ming: One approach I like to use is trace event. >>> Would you please let us how to to use trace event for calculate >>> max/average usb irq time? >> >> You can enable irq_handler_entry and irq_handler_exit event, then >> write a script easi

Re: questions about give back urb in tasklet

2014-03-19 Thread Ming Lei
I said, spin_lock() isn't converted to spin_lock_irqsave() in drivers' completion handler yet - maybe no one really care the time in which local interrupt is disabled by USB completion handler.(That might be true because USB devices are commonly used in personal computer, not in bi

Re: questions about give back urb in tasklet

2014-03-19 Thread Ming Lei
ndler in BH, isn't that what you need? But actually the local interrupt is still disabled during completion because we need to convert spin_lock in all current usb drivers to spin_lock_irqsave() first. I posted lot of patches to do the conversion, but unfortunately most of them aren't m

Re: 3.13-rc1 regression: Scatter-gather list issues at SuperSpeed only

2014-03-04 Thread Ming Lei
storage too since the single URB in the middle of transfer produces short packet. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: 3.13-rc1 regression: Scatter-gather list issues at SuperSpeed only

2014-03-04 Thread Ming Lei
So when this SS storage device(maxp isn't 512) comes and block layer may send scatter-gather list with an non-tail entry that isn't aligned to the max packet size, looks xHCD has to enable no_sg_constraint and has to deal with it correctly, and I am wondering if there is other

Re: 3.13-rc1 regression: Scatter-gather list issues at SuperSpeed only

2014-03-03 Thread Ming Lei
s broken, so it looks > like we'll have to revert the last patch to add scatter-gather to the > ASIX driver to avoid that breakage. That means Mathias is going to need > to revert those two commits then, since he's taking over pushing xHCI > driver bug fixes this ke

Re: [PATCH RFC 1/1] usb: Tell xhci when usb data might be misaligned

2014-02-01 Thread Ming Lei
On Sat, Feb 1, 2014 at 9:30 PM, Mark Lord wrote: > On 14-02-01 02:54 AM, Ming Lei wrote: > .. >> With SG enabled, for the iperf client test case, the average urb size >> for transmission will be increased from ~1500 to ~20K bytes in my >> test case: >> >>

Re: [PATCH RFC 1/1] usb: Tell xhci when usb data might be misaligned

2014-01-31 Thread Ming Lei
On Sat, Feb 1, 2014 at 3:00 AM, Sarah Sharp wrote: > On Fri, Jan 31, 2014 at 08:17:58AM +0800, Ming Lei wrote: >> On Fri, Jan 31, 2014 at 6:15 AM, Sarah Sharp >> wrote: >> > On Thu, Jan 30, 2014 at 10:50:21PM +0100, Bjørn Mork wrote: >> >> FWIW, the plan loo

Re: [PATCH RFC 1/1] usb: Tell xhci when usb data might be misaligned

2014-01-30 Thread Ming Lei
ce improvement introduced in 3.12. >> >> No other usbnet drivers has enabled SG... Which is why you have only >> seen this problem with the ax88179_178a devices. So there is no >> performance improvement to keep. In my test environment, the patch does improve both throughput and cpu utilization, if you search the previous email for the patch, you can see the data. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: PROBLEM: usbnet / ax88179_178a: Panic in usb_hcd_map_urb_for_dma

2014-01-15 Thread Ming Lei
or the usb3 and 'normal' ethernet interfaces. > > While each bit doesn't seem significant, they soon add up. If you plan to remove the 'nents' parameter, I am wondering if it is a good idea, because sg_nents() should be more heavy. Not mention sometimes the callers just w

Re: [PATCH net,stable] net: usbnet: fix SG initialisation

2014-01-11 Thread Ming Lei
On Sat, Jan 11, 2014 at 5:16 PM, Ming Lei wrote: > On Sat, Jan 11, 2014 at 6:10 AM, Bjørn Mork wrote: >> Commit 60e453a940ac ("USBNET: fix handling padding packet") >> added an extra SG entry in case padding is necessary, but >> failed to update the initialisation

Re: [PATCH net,stable] net: usbnet: fix SG initialisation

2014-01-11 Thread Ming Lei
ff the end of the list, > resulting in an oops. > > Fixes: 60e453a940ac ("USBNET: fix handling padding packet") > Reported-by: Thomas Kear > Cc: Ming Lei > Signed-off-by: Bjørn Mork > --- > I don't have the hardware to verify this fix. It would be good if > someon

[PATCH v1] USB: storage: fix compile warning

2013-12-09 Thread Ming Lei
y: Stephen Rothwell Signed-off-by: Ming Lei --- drivers/usb/storage/protocol.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c index f54e5fe..12e3c2f 100644 --- a/drivers/usb/storage/protocol.c +++ b/drivers/u

Re: [PATCH] USB: storage: fix compile warning

2013-12-09 Thread Ming Lei
On Tue, Dec 10, 2013 at 1:05 PM, Greg Kroah-Hartman wrote: > On Tue, Dec 10, 2013 at 12:37:24PM +0800, Ming Lei wrote: >> This patch should fix the below compile warning: >> >> drivers/usb/storage/protocol.c: In function 'usb_stor_access_xfer_buf': >>

[PATCH] USB: storage: fix compile warning

2013-12-09 Thread Ming Lei
This patch should fix the below compile warning: drivers/usb/storage/protocol.c: In function 'usb_stor_access_xfer_buf': drivers/usb/storage/protocol.c:155:22: warning: comparison of distinct pointer types lacks a cast [enabled by default] Reported-by: kbuild test robot Reported-by: Stephen Roth

Re: [PATCH v1 1/2] lib/scatterlist: export sg_miter_skip()

2013-12-01 Thread Ming Lei
On Sat, Nov 30, 2013 at 6:23 AM, Tejun Heo wrote: > On Tue, Nov 26, 2013 at 12:43:37PM +0800, Ming Lei wrote: >> sg_copy_buffer() can't meet demand for some drrivers(such usb >> mass storage), so we have to use the sg_miter_* APIs to access >> sg buffer, then need export

[PATCH v1 1/2] lib/scatterlist: export sg_miter_skip()

2013-11-25 Thread Ming Lei
ed-by: Andrew Morton Cc: FUJITA Tomonori Cc: Tejun Heo Cc: Jens Axboe Signed-off-by: Ming Lei --- include/linux/scatterlist.h |1 + lib/scatterlist.c |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/scatterlist.h b/include/linux/scatterl

Re: [PATCH 2/2] USB: storage: use sg_miter_* APIs to access scsi buffer

2013-11-01 Thread Ming Lei
On Fri, Nov 1, 2013 at 10:54 PM, Alan Stern wrote: > On Wed, 30 Oct 2013, Ming Lei wrote: > >> We have sg_miter_* APIs for accessing scsi sg buffer, so >> use them to make code clean and bug free. > > Hmmm. You could simply call sg_copy_buffer, if you didn't mind th

Re: [PATCH 1/2] lib/scatterlist: export sg_miter_skip()

2013-10-31 Thread Ming Lei
ing & commenting on 2/2 and merge the two finally to usb-next tree if you are OK with it? Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/2] USB: storage: use sg_miter_* APIs to access scsi buffer

2013-10-29 Thread Ming Lei
We have sg_miter_* APIs for accessing scsi sg buffer, so use them to make code clean and bug free. Cc: Matthew Dharm Cc: Alan Stern Cc: Greg Kroah-Hartman Signed-off-by: Ming Lei --- drivers/usb/storage/protocol.c | 82 ++-- 1 file changed, 28 insertions

[PATCH 1/2] lib/scatterlist: export sg_miter_skip()

2013-10-29 Thread Ming Lei
. Cc: Andrew Morton , Cc: FUJITA Tomonori , Cc: Tejun Heo , Cc: Jens Axboe Signed-off-by: Ming Lei --- include/linux/scatterlist.h |1 + lib/scatterlist.c |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h

Re: [PATCH] usb-storage: scsiglue: Changing the command result

2013-10-15 Thread Ming Lei
tire usb storage"? Aren't they the same thing? > >> Or maybe scsi has >> decided to abort so it should override the result. > > Of course the SCSI midlayer has decided to abort. That's the only way > this bit can get set. But usb-storage doesn't know why S

Re: [PATCH] usb-storage: scsiglue: Changing the command result

2013-10-15 Thread Ming Lei
esult is replaced with DID_TIME_OUT now. Another way is to implement .eh_timed_out callback to return different error for the two failure, but looks not a big deal. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-10 Thread Ming Lei
iscussions first before post your V2. Below link is one I remembered, but I think you can find more: https://lkml.org/lkml/2013/8/11/100 > This is all dependent on what the dev.id is of udev. I am not sure why it depends on udev, and udev can't see the device util it is added to system. Th

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-10 Thread Ming Lei
ode. > > I will need to post V2 for that. Your patch still doesn't deal with two smsc95xx devices built in one board. The problem is a generic one, looks it is better to do it when OF supports discoverable bus. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-07 Thread Ming Lei
On Mon, Oct 7, 2013 at 1:31 AM, Dan Murphy wrote: > On 10/06/2013 10:05 AM, Ming Lei wrote: >> On Sat, Oct 5, 2013 at 2:25 AM, Dan Murphy wrote: >>> If the smsc95xx does not have a valid MAC address stored within >>> the eeprom then a random number is generated. The

Re: [PATCH] usbnet: smsc95xx: Add device tree input for MAC address

2013-10-06 Thread Ming Lei
ot;MAC address read from > DTB\n"); > + return; > + } > + } > +#endif > + > /* try reading mac address from EEPROM */ > if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, > dev->net-

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-05 Thread Ming Lei
On Sat, Oct 5, 2013 at 11:10 PM, Alan Stern wrote: > On Sat, 5 Oct 2013, Ming Lei wrote: > >> > The buffer should be cached. The userspace program will have to make >> > sure that it doesn't try to access the buffer while DMA is in progress. >> > As long

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-10-05 Thread Ming Lei
if the memory is already almost full? The call to > alloc_pages_exact() could fail. > > I agree this is less likely than a failure with the current system, but > it is still possible. With CONFIG_COMPACTION enabled, it is hard to trigger the allocation failure, and actually on some ARCHs, size of

Re: [PATCH] memory mapping for usbfs (v0.4)

2013-09-29 Thread Ming Lei
gt; BULK Why do you want to override SG transfer? > * adding pgprot_noncached to ensure that the IO memory is not cached Accessing non-cached mapping on some ARCHs is extremely slow, so I an wondering if it is good way to map the area as non-cached. Thanks, -- Ming Lei -- To unsubscr

Re: [PATCH] Memory mapping for USBFS

2013-09-29 Thread Ming Lei
On Sun, Sep 29, 2013 at 8:18 PM, Markus Rechberger wrote: > On Sun, Sep 29, 2013 at 2:07 PM, Ming Lei wrote: >> On Sun, Sep 29, 2013 at 7:51 PM, Markus Rechberger >> wrote: >> >>> >>> I agree, but here not only small buffers are the problem, also lat

Re: [PATCH] Memory mapping for USBFS

2013-09-29 Thread Ming Lei
od: - URB can only be submitted in process context with context switch cost - URB complete is notified by signal, which might introduce much latency With one kernel mode driver, you can get better performance/latency much easily. Thanks, -- Ming Lei -- To unsubscribe from this list: send the lin

Re: [PATCH] Memory mapping for USBFS

2013-09-28 Thread Ming Lei
er usb mass storage block device. > > This may depend more on the host controller capabilities than on the > CPU architecture. Yes, but for most cases, more than 4GB ram is seldom used in 32bit CPU. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscrib

Re: [PATCH] Memory mapping for USBFS

2013-09-27 Thread Ming Lei
On Sat, Sep 28, 2013 at 10:29 AM, Alan Stern wrote: > On Sat, 28 Sep 2013, Ming Lei wrote: > >> On Wed, Sep 25, 2013 at 3:12 AM, Markus Rechberger >> wrote: >> > This patch adds memory mapping support to USBFS for isochronous and bulk >> > data transfers, it

Re: [PATCH] Memory mapping for USBFS

2013-09-27 Thread Ming Lei
ated to user space directly), which should be more flexible, and user don't need to use mmap/munmap, so should be easier to use. At least, wrt. usb mass storage test, both CPU utilization and throughput can be improved with direct I/O. Thanks, -- Ming Lei -- To unsubscribe from this list: sen

Re: [PATCH v1] USBNET: fix handling padding packet

2013-09-27 Thread Ming Lei
On Mon, Sep 23, 2013 at 8:59 PM, Ming Lei wrote: > Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG > if the usb host controller is capable of building packet from > discontinuous buffers, but missed handling padding packet when > building DMA SG. > > This pat

[PATCH v1] USBNET: fix handling padding packet

2013-09-23 Thread Ming Lei
packet can be sent to device if drivers require that. Reported-by: David Laight Acked-by: Oliver Neukum Signed-off-by: Ming Lei --- v1: - fix bug in case of dev->can_dma_sg and !urb->num_sgs --- drivers/net/usb/usbnet.c | 27 +-- include/linux/usb/us

Re: Cannot shutdown power use from built in webcam in thinkpad T530 questions]

2013-09-22 Thread Ming Lei
here is application which is using the device by 'lsof | grep "/dev/video"'. Also looks power usage estimation of 'power top' should be used when battery provides power, and the data isn't correct if power is provided from power adapter, if I remember correctly.

Re: [PATCH] USBNET: fix handling padding packet

2013-09-19 Thread Ming Lei
devices' drivers converted to sg. > > I wonder what the gain of that really is? Yes, I can see the advantage > of making the class drivers more effective. But padding is only > relevant for the ECM class, isn't it? And are there any ECM class > devices where SG support mat

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Ming Lei
On Wed, Sep 18, 2013 at 11:52 PM, Bjørn Mork wrote: > Ming Lei writes: > >>> Are you really sure that the one driver/device using this really need >>> the padding byte? If you could just make FLAG_SEND_ZLP part of the >>> condition for enabling can_dma_sg, the

Re: [PATCH] USBNET: fix handling padding packet

2013-09-18 Thread Ming Lei
On Wed, Sep 18, 2013 at 9:59 PM, Bjørn Mork wrote: > Ming Lei writes: > >> Commit 638c5115a7949(USBNET: support DMA SG) introduces DMA SG >> if the usb host controller is capable of building packet from >> discontinuous buffers, but missed handling padding packet

[PATCH] USBNET: fix handling padding packet

2013-09-17 Thread Ming Lei
packet can be sent to device if drivers require that. Reported-by: David Laight Cc: Oliver Neukum Signed-off-by: Ming Lei --- drivers/net/usb/usbnet.c | 27 +-- include/linux/usb/usbnet.h |1 + 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers

Re: usbnet transmit path problems

2013-09-16 Thread Ming Lei
On Mon, Sep 16, 2013 at 4:13 PM, Oliver Neukum wrote: > On Thu, 2013-09-12 at 09:56 +0800, Ming Lei wrote: >> On Thu, Sep 12, 2013 at 12:05 AM, David Laight >> wrote: > >> Patches are always welcome, :-) > > Indeed, I think your patch, if no better alternatives c

Re: usbnet transmit path problems

2013-09-11 Thread Ming Lei
ded correctly (the code probably falls off >> >> > >the end of the scatter-gather list). >> >> > >> >> > Indeed. Ming Lei, should usbnet handle this in the sg case or better >> >> > leave it to the subdriver you introduced thi

Re: usbnet transmit path problems

2013-09-11 Thread Ming Lei
On Wed, Sep 11, 2013 at 8:56 PM, David Laight wrote: >> > > 2) If 'length % dev->maxpacket == 0' for a multi-fragment packet then >> > >the extra byte isn't added correctly (the code probably falls off >> > >the end of the scatter-g

Re: [RFC 2/3] EHCI: convert the IRQ handler to a tasklet

2013-08-29 Thread Ming Lei
On Tue, Aug 27, 2013 at 10:39 PM, Alan Stern wrote: > On Tue, 27 Aug 2013, Ming Lei wrote: > >> > Yes. A new spinlock would be needed to synchronize the top half and >> > the bottom half. The same spinlock would also be used to avoid >> > scheduling the tasklet

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-29 Thread Ming Lei
On Thu, Aug 29, 2013 at 12:05 AM, Alan Stern wrote: > On Wed, 28 Aug 2013, Ming Lei wrote: > >> > Think about it this way: Why did you write the "USB: EHCI: improve >> > interrupt qh unlink" patch in the first place? Essentially the same >> > reason

Re: [RFC 3/3] EHCI: handle late isochronous submissions

2013-08-28 Thread Ming Lei
bout to scan > again; they mustn't get scanned until the frame pointer has wrapped > around. > > This last problem in particular means your proposal can't be accepted. On Thu, Aug 29, 2013 at 8:43 AM, Ming Lei wrote: > No, no other TDs scheduled for the frames since the queu

Re: [RFC 3/3] EHCI: handle late isochronous submissions

2013-08-28 Thread Ming Lei
On Thu, Aug 29, 2013 at 12:23 AM, Alan Stern wrote: > On Wed, 28 Aug 2013, Ming Lei wrote: > >> Below is the approach I proposed(mentioned in another thread), which should >> be >> simper than this one, any comments? >> >>

Re: [RFC 3/3] EHCI: handle late isochronous submissions

2013-08-28 Thread Ming Lei
unsignedlast_base; /* previous 'last_iso_frame' */ unsignedlast_iso_frame; /* last frame scanned for iso */ unsignedintr_count; /* intr activity count */ unsignedisoc_count; /* isoc activity count */ Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-28 Thread Ming Lei
On Wed, Aug 28, 2013 at 12:24 PM, Ming Lei wrote: > On Wed, 28 Aug 2013 12:02:03 +0800 > Ming Lei wrote: > >> Actually the problem only happened when underrun without >> URB_ISO_ASAP. >> >> I have another fix which uses rebase trick and is simper(less cha

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-27 Thread Ming Lei
On Wed, 28 Aug 2013 12:02:03 +0800 Ming Lei wrote: > Actually the problem only happened when underrun without > URB_ISO_ASAP. > > I have another fix which uses rebase trick and is simper(less change), could > you comment on the attachment patch? Sorry, please ignore last attach

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-27 Thread Ming Lei
On Tue, Aug 27, 2013 at 10:55 PM, Alan Stern wrote: > On Tue, 27 Aug 2013, Ming Lei wrote: > >> > I don't understand your argument. The uhci-hcd _does_ support >> > interrupt URBs being submitted from tasklets, workqueues, kernel >> > threads, or whatever

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-27 Thread Ming Lei
On Tue, Aug 27, 2013 at 4:05 AM, Alan Stern wrote: > On Mon, 26 Aug 2013, Ming Lei wrote: > >> > The problem is that once an interrupt QH has been unlinked, relinking >> > it might not make it visible to the hardware until the next frame >> > starts. Ther

Re: [RFC 2/3] EHCI: convert the IRQ handler to a tasklet

2013-08-26 Thread Ming Lei
On Mon, Aug 26, 2013 at 11:29 PM, Alan Stern wrote: > On Mon, 26 Aug 2013, Ming Lei wrote: > >> > On Sat, 24 Aug 2013, Ming Lei wrote: >> > >> >> But the current interrupt from EHCI isn't be acked(USBSTS isn't cleared), >> >> so EHCI HW

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-26 Thread Ming Lei
On Sun, Aug 25, 2013 at 11:39 PM, Alan Stern wrote: > On Sat, 24 Aug 2013, Ming Lei wrote: > >> >> >> For other HCDs, this changes on interrupt QH unlink may not need at all >> >> >> if there is no much cost about relink. >> >> > >&g

Re: [RFC 2/3] EHCI: convert the IRQ handler to a tasklet

2013-08-25 Thread Ming Lei
I will respond to the points you > raised in your review. OK, I will ask Greg to put back the patch 'USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled' into his tree. > > On Sat, 24 Aug 2013, Ming Lei wrote: > >> But the current in

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-23 Thread Ming Lei
On Fri, Aug 23, 2013 at 11:40 PM, Alan Stern wrote: > On Fri, 23 Aug 2013, Ming Lei wrote: > >> On Fri, Aug 23, 2013 at 4:36 AM, Alan Stern >> wrote: >> > On Thu, 22 Aug 2013, Ming Lei wrote: >> > >> >> > This seems to be the most important fac

Re: [RFC 2/3] EHCI: convert the IRQ handler to a tasklet

2013-08-23 Thread Ming Lei
On Sat, Aug 24, 2013 at 12:06 AM, Alan Stern wrote: > On Fri, 23 Aug 2013, Ming Lei wrote: > >> On Fri, Aug 23, 2013 at 4:39 AM, Alan Stern >> wrote: >> > This patch divides ehci-hcd's interrupt handler into a top half and a >> > bottom half, using a tas

Re: [RFC 2/3] EHCI: convert the IRQ handler to a tasklet

2013-08-22 Thread Ming Lei
On Fri, Aug 23, 2013 at 4:39 AM, Alan Stern wrote: > This patch divides ehci-hcd's interrupt handler into a top half and a > bottom half, using a tasklet to execute the latter. > > The conversion is very straightforward. The only subtle point is that > we have to ignore interrupts that arrive whi

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-22 Thread Ming Lei
On Fri, Aug 23, 2013 at 4:36 AM, Alan Stern wrote: > On Thu, 22 Aug 2013, Ming Lei wrote: > >> > This seems to be the most important factor. When you think about it, >> > though, does it really minimize the changes? Consider all the other >> > adjustment

Re: [PATCH v1 24/49] BT: btusb: prepare for enabling irq in complete()

2013-08-22 Thread Ming Lei
On Sun, Aug 18, 2013 at 12:24 AM, Ming Lei wrote: > Complete() will be run with interrupt enabled, so change to > spin_lock_irqsave(). > > Cc: Marcel Holtmann > Cc: Gustavo Padovan > Cc: Johan Hedberg > Cc: linux-blueto...@vger.kernel.org > Signed-off-by: Ming Lei M

Re: [PATCH v1 23/49] hid: usbhid: prepare for enabling irq in complete()

2013-08-22 Thread Ming Lei
On Sun, Aug 18, 2013 at 12:24 AM, Ming Lei wrote: > Complete() will be run with interrupt enabled, so change to > spin_lock_irqsave(). > > Cc: Jiri Kosina > Cc: linux-in...@vger.kernel.org > Signed-off-by: Ming Lei Jiri, could you review and give an Ack? Thanks, -- Ming Lei

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-22 Thread Ming Lei
On Thu, Aug 22, 2013 at 4:58 PM, Ming Lei wrote: > On Wed, Aug 21, 2013 at 11:23 PM, Alan Stern > wrote: >> I'm starting to think that moving the entire handler to a tasklet would >> have been better. > > Not sure, if so: > > - one thing is that the HCD priv

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-22 Thread Ming Lei
On Wed, Aug 21, 2013 at 11:23 PM, Alan Stern wrote: > On Wed, 21 Aug 2013, Ming Lei wrote: > >> > By the way, even though it's a little late to ask this... Why did you >> > decide to move only the giveback routine into a tasklet, instead of >> > moving the

Re: [PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-21 Thread Ming Lei
, so moving complete() to tasklet can help to decrease HCD irq handling time. Also moving only the giveback routine into a tasklet can avoid dropping HCD private lock during irq handler, which may simplify HCD code, and I have figured out ehci cleanup patches for this. Thanks, -- Ming Lei --

[PATCH v1] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-21 Thread Ming Lei
expirations/sec (20% ~ 30% of totoal timer expirations/sec) can be saved when one asix network NIC is connected to EHCI without network traffic(the device responds interrupt poll 7~8 times per second constantly for link status query). Cc: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/host/ehci

Re: Non-enumerable devices on USB and other enumerable buses

2013-08-20 Thread Ming Lei
On Tue, Aug 20, 2013 at 12:01 AM, Mark Brown wrote: > On Mon, Aug 19, 2013 at 08:17:53PM +0800, Ming Lei wrote: >> On Sat, Aug 17, 2013 at 9:29 AM, Alan Stern >> wrote: > >> > Aong those lines, I would like to point out that the device concept >> > embodied

Re: [PATCH 3/3] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-20 Thread Ming Lei
t comes. > What does this help with? Measurements please. The patch may avoid unnecessary CPU wakeups caused by timer expiration, and measurement is provided below. On Mon, Aug 19, 2013 at 11:30 PM, Alan Stern wrote: > On Mon, 19 Aug 2013, Ming Lei wrote: > >> This patch introduces

Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
On Mon, Aug 19, 2013 at 11:33 PM, Alan Stern wrote: > On Mon, 19 Aug 2013, Ming Lei wrote: > >> > As far as I can see, this counter does not need to be exact. Why not >> > simply make it a non-atomic unsigned int? >> >> It may becomes quite inaccurate, and 4

Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
On Mon, Aug 19, 2013 at 11:14 PM, Greg Kroah-Hartman wrote: > On Mon, Aug 19, 2013 at 11:06:31PM +0800, Ming Lei wrote: >> On Mon, Aug 19, 2013 at 10:00 PM, Greg Kroah-Hartman >> wrote: >> > On Mon, Aug 19, 2013 at 07:04:18PM +0800, Ming Lei wrote: >> >>

Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
On Mon, Aug 19, 2013 at 11:17 PM, Alan Stern wrote: > On Mon, 19 Aug 2013, Ming Lei wrote: > >> On Mon, Aug 19, 2013 at 10:42 PM, Alan Stern >> wrote: >> > On Mon, 19 Aug 2013, Ming Lei wrote: >> > >> >> Because usb_hcd_submit_urb is in the hote

Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
On Mon, Aug 19, 2013 at 10:42 PM, Alan Stern wrote: > On Mon, 19 Aug 2013, Ming Lei wrote: > >> Because usb_hcd_submit_urb is in the hotest path of usb core, >> so use percpu counter to count URB instead of using atomic variable >> because atomic operations are much slowe

Re: [PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
On Mon, Aug 19, 2013 at 10:00 PM, Greg Kroah-Hartman wrote: > On Mon, Aug 19, 2013 at 07:04:18PM +0800, Ming Lei wrote: >> Because usb_hcd_submit_urb is in the hotest path of usb core, >> so use percpu counter to count URB instead of using atomic variable >> because atomi

Re: Non-enumerable devices on USB and other enumerable buses

2013-08-19 Thread Ming Lei
, I think it's time to try to implement something rather than talk >> about it. > > Hopefully this discussion has given you some ideas for alternative > approachs, or at least helped to solidify your ideas. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[RFC PATCH 2/3] USB: kill urb->use_count atomic variable

2013-08-19 Thread Ming Lei
ng the flag is still kept as atomic but ARCH's atomic operations(atomic_inc/ atomic_dec) are saved. Cc: Oliver Neukum Cc: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/core/hcd.c | 14 +- drivers/usb/core/urb.c |8 ++-- drivers/usb/core/usb.h |5 + include/li

[PATCH 3/3] USB: EHCI: disable IAA_WATCHDOG and START_UNLINK_INTR if they needn't to be handled

2013-08-19 Thread Ming Lei
This patch introduces ehci_disable_event(), which is applied on IAA_WATCHDOG and START_UNLINK_INTR events in case that the two events needn't to be handled, so that we may avoid unnecessary CPU wakeup. Cc: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/host/ehci-hcd.c |

[PATCH 1/3] USB: use percpu counter to count submitted URBs per device

2013-08-19 Thread Ming Lei
Because usb_hcd_submit_urb is in the hotest path of usb core, so use percpu counter to count URB instead of using atomic variable because atomic operations are much slower than percpu operations. Cc: Oliver Neukum Cc: Alan Stern Signed-off-by: Ming Lei --- drivers/usb/core/hcd.c |4

Re: [PATCH v1 02/49] USB: sg: prepare for enabling irq in complete()

2013-08-18 Thread Ming Lei
On Sun, Aug 18, 2013 at 10:44 PM, Alan Stern wrote: > On Sun, 18 Aug 2013, Ming Lei wrote: > >> > As far as I can see, these don't need to disable interrupts. All they >> > protect against is the code in usb_sg_wait() and usb_sg_cancel(), which >> >

  1   2   3   4   5   6   7   8   9   >