Re: [debian bug:883345] vhci-hcd: kernel oops when attaching a mass storage on client side of usbip

2017-12-05 Thread borissh1983
On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote: > On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com wrote: > > Hi , > > > > vhci-hcd kernel oops when attaching a mass storage on 4.13.13. > > > > When I try to attach a mass storage device to a vhci-hcd, it generates an > > oop

Re: [PATCH v4] usb: xhci: allow imod-interval to be configurable

2017-12-05 Thread Mathias Nyman
On 05.12.2017 04:54, Adam Wallis wrote: On 12/4/2017 9:15 PM, Chunfeng Yun wrote: On Mon, 2017-12-04 at 09:27 -0500, Adam Wallis wrote: The xHCI driver currently has the IMOD set to 160, which translates to an IMOD interval of 40,000ns (160 * 250)ns Commit 0cbd4b34cda9 ("xhci: mediatek: suppor

Re: Several issues on AMD Promontory [1022:43bb]

2017-12-05 Thread Kai Heng Feng
> On 5 Dec 2017, at 4:52 PM, Joe Lee wrote: > > Hi Kai-Hen, > I want to know what this kernel version? v4.15-rc2. The issue happens on all kernel version though. > > >All three issue can still be reproduced with or without your patch, > >"[PATCH v8] xhci : AMD Promontory USB disable port supp

Re: [PATCH v9] xhci : AMD Promontory USB disable port support

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 05:20:56PM +0800, Joe Lee wrote: > Dear Greg: > I am sorry if this has caused you any inconvenience. > I can't understand what is a good line-wrapping. > Can you check the line-wrapping for me? > > > For AMD Promontory xHCI host, > > although you can disable USB 2.0 ports i

Re: [PATCH v3 07/16] phy: qcom-qusb2: Add support for different register layouts

2017-12-05 Thread Vivek Gautam
On 11/21/2017 02:53 PM, Manu Gautam wrote: New version of QUSB2 PHY has some registers offset changed. Add support to have register layout for a target and update the same in phy_configuration. Signed-off-by: Manu Gautam --- drivers/phy/qualcomm/phy-qcom-qusb2.c | 131 ++

Re: [PATCH 21/45] usb: typec: remove duplicate includes

2017-12-05 Thread Guenter Roeck
On 12/04/2017 06:04 PM, Pravin Shedge wrote: These duplicate includes have been found with scripts/checkincludes.pl but they have been removed manually to avoid removing false positives. Signed-off-by: Pravin Shedge Reviewed-by: Guenter Roeck --- drivers/usb/typec/fusb302/fusb302.c | 1 -

Re: Rectifying: xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 01:38:02PM +0100, Luca Osvaldo Mastromatteo wrote: > Hi, I've reported some problems I'm having with this driver to the > linux kernel bugzilla and they gave me this mail, so I'm copying and > paste the issue I wrote in there. Thanks > > 'I've recently bought an USB 3.0 SAT

[PATCH] musb-fixes for v4.15-rc3

2017-12-05 Thread Bin Liu
Hi Greg, Here is only one musb patch for the next v4.15 -rc, which fixes the babble condition handling for DA8xx. Please let me know if any change is needed. Thanks, -Bin. --- Bin Liu (1): usb: musb: da8xx: fix babble condition handling drivers/usb/musb/da8xx.c | 10 +- 1 file change

[PATCH] usb: musb: da8xx: fix babble condition handling

2017-12-05 Thread Bin Liu
When babble condition happens, the musb controller might automatically turns off VBUS. On DA8xx platform, the controller generates drvvbus interrupt for turning off VBUS along with the babble interrupt. In this case, we should handle the babble interrupt first and recover from the babble condition

Re: [RFC PATCH 0/2] usb: typec: alternate mode bus

2017-12-05 Thread Hans de Goede
Hi, On 01-12-17 09:38, Heikki Krogerus wrote: Hi, Thanks for taking a look at this.. On Sun, Nov 26, 2017 at 12:23:31PM +0100, Hans de Goede wrote: Hi Heiko, On 28-09-17 13:35, Heikki Krogerus wrote: Hi guys, The bus allows SVID specific communication with the partners to be handled in sep

RE: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status()

2017-12-05 Thread Alan Stern
On Tue, 5 Dec 2017, Yoshihiro Shimoda wrote: > Hi, > > > From: Ulf Hansson, Sent: Monday, December 4, 2017 7:41 PM > > > > On 1 December 2017 at 12:03, Yoshihiro Shimoda > > wrote: > > > > Sure! I tested your patch, and then the following message disappeared! > > > > > >Enabling runtime PM

[PATCH] tools/usbip: fixes potential (minor) "buffer overflow" (detected on recent gcc with -Werror)

2017-12-05 Thread julien . boibessot
From: Julien BOIBESSOT Fixes following build error: vhci_driver.c: In function 'refresh_imported_device_list': vhci_driver.c:118:37: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=] snprintf(status, sizeof(status), "status.%d", i)

Re: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status()

2017-12-05 Thread Rafael J. Wysocki
On Tue, Dec 5, 2017 at 4:03 PM, Alan Stern wrote: > On Tue, 5 Dec 2017, Yoshihiro Shimoda wrote: > >> Hi, >> >> > From: Ulf Hansson, Sent: Monday, December 4, 2017 7:41 PM >> > >> > On 1 December 2017 at 12:03, Yoshihiro Shimoda >> > wrote: >> >> > > Sure! I tested your patch, and then the follo

[GIT PULL] USB driver fixes for 4.15-rc3

2017-12-05 Thread Greg KH
The following changes since commit 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323: Linux 4.15-rc1 (2017-11-26 16:01:47 -0800) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/ tags/usb-4.15-rc3 for you to fetch changes up to 80e457699a8dbdd70f2

Re: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status()

2017-12-05 Thread Ulf Hansson
On 5 December 2017 at 04:23, Yoshihiro Shimoda wrote: > Hi, > >> From: Ulf Hansson, Sent: Monday, December 4, 2017 7:41 PM >> >> On 1 December 2017 at 12:03, Yoshihiro Shimoda >> wrote: > >> > Sure! I tested your patch, and then the following message disappeared! >> > >> >Enabling runtime PM

Re: [debian bug:883345] vhci-hcd: kernel oops when attaching a mass storage on client side of usbip

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 10:17:08AM +0200, borissh1...@gmail.com wrote: > On Tuesday, 5 December 2017 9:39:33 IST Greg KH wrote: > > On Mon, Dec 04, 2017 at 10:05:45PM +0200, borissh1...@gmail.com wrote: > > > Hi , > > > > > > vhci-hcd kernel oops when attaching a mass storage on 4.13.13. > > > >

[PATCH v1 8/8] lsusb: Dump USB3 BOS Configuration Summary Descriptor.

2017-12-05 Thread Michael Drake
--- lsusb.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/lsusb.c b/lsusb.c index c9d0d74..ddc19e0 100644 --- a/lsusb.c +++ b/lsusb.c @@ -75,6 +75,7 @@ #define USB_DC_PLATFORM0x05 #define USB_DC_SUPERSPEEDPLUS 0x0a #define USB_DC_BILLBOARD 0x0d

[PATCH v1 4/8] lsusb: Switch to descriptor-definition based dump for UAC1 and UAC2.

2017-12-05 Thread Michael Drake
This gives us more consistency in handling of incorrect descriptor buffer lengths, and improves whitespace/alignment consistency. --- Makefile.am | 2 + lsusb.c | 779 +--- 2 files changed, 63 insertions(+), 718 deletions(-) diff --git

[PATCH v1 0/8] lsusb: Add initial support for USB Audio Class 3

2017-12-05 Thread Michael Drake
This adds a new way of dumping descriptors, which splits the knowledge of how to interpret descriptor data from the actual dumping. This has two advantages: 1. It is easy to add support for new descriptors, since they are now simple definitions that resemble the tables in the USB specifications

[PATCH v1 1/8] lsusb: Split subtype mapping out of AudioControl interface handling.

2017-12-05 Thread Michael Drake
UAC1 and UAC2 have different different meanings for the same subtype value. This splits the subtype mapping out. --- lsusb.c | 100 ++-- 1 file changed, 79 insertions(+), 21 deletions(-) diff --git a/lsusb.c b/lsusb.c index f611f2e..c35

[PATCH v1 7/8] lsusb: Add descriptor definition for USB3 BOS Configuration Summary.

2017-12-05 Thread Michael Drake
--- desc-defs.c | 16 desc-defs.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/desc-defs.c b/desc-defs.c index 3b5ea1e..885e3fa 100644 --- a/desc-defs.c +++ b/desc-defs.c @@ -892,3 +892,19 @@ const struct desc * const desc_audio_as_isochronous_audio_data_endpoint[3]

[PATCH v1 3/8] lsusb: Add code to dump descriptor data using descriptor definition.

2017-12-05 Thread Michael Drake
This adds a new way of dumping descriptors. It takes the descriptor data to be dumped, and a descriptor definition as input. The descriptor definition takes the form of a NULL terminated array of descriptor field definitions. These definitions describe how the raw descriptor data buffer should b

[PATCH v1 2/8] lsusb: Add declarative definitions for UAC1 and UAC2 descriptors.

2017-12-05 Thread Michael Drake
These descriptor definitions descibe how raw descriptor data should be interpreted. --- desc-defs.c | 647 desc-defs.h | 153 ++ 2 files changed, 800 insertions(+) create mode 100644 desc-defs.c create mode 100644 desc-defs

[PATCH v1 6/8] lsusb: Add initial support for UAC3.

2017-12-05 Thread Michael Drake
--- lsusb.c | 52 ++-- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/lsusb.c b/lsusb.c index ac6e061..c9d0d74 100644 --- a/lsusb.c +++ b/lsusb.c @@ -106,6 +106,11 @@ #define USB_AUDIO_CLASS_2 0x20 #endif +/* USB DCD

[PATCH v1 5/8] lsusb: Add descriptor definitions for UAC3.

2017-12-05 Thread Michael Drake
--- desc-defs.c | 277 desc-defs.h | 3 + desc-dump.c | 5 ++ 3 files changed, 270 insertions(+), 15 deletions(-) diff --git a/desc-defs.c b/desc-defs.c index 6bc558e..3b5ea1e 100644 --- a/desc-defs.c +++ b/desc-defs.c @@ -61,6 +61,

Re: [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away

2017-12-05 Thread Stefan Wahren
Hi Felipe, Hi John, Am 30.10.2017 um 18:08 schrieb Douglas Anderson: On rk3288-veyron devices on Chrome OS it was found that plugging in an Arduino-based USB device could cause the system to lockup, especially if the CPU Frequency was at one of the slower operating points (like 100 MHz / 200 MH

[PATCH] xhci: Fix front USB ports on ASUS PRIME B350M-A

2017-12-05 Thread Kai-Heng Feng
The board in question has three XHCI HCs: 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] USB 3.1 XHCI Controller [1022:43bb] (rev 02) 04:00.0 USB controller [0c03]: ASMedia Technology Inc. Device [1b21:1343] 0a:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] USB3

Re: [PATCH v1 1/8] lsusb: Split subtype mapping out of AudioControl interface handling.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:24PM +, Michael Drake wrote: > UAC1 and UAC2 have different different meanings for the same subtype > value. This splits the subtype mapping out. > --- Minor nit, can you sign-off on your patches like kernel patches have? That way I know you are contributing this

Re: [PATCH v1 2/8] lsusb: Add declarative definitions for UAC1 and UAC2 descriptors.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:25PM +, Michael Drake wrote: > These descriptor definitions descibe how raw descriptor data > should be interpreted. > --- > desc-defs.c | 647 > > desc-defs.h | 153 ++ > 2 files changed, 8

Re: [PATCH v1 3/8] lsusb: Add code to dump descriptor data using descriptor definition.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:26PM +, Michael Drake wrote: > This adds a new way of dumping descriptors. It takes the descriptor > data to be dumped, and a descriptor definition as input. > > The descriptor definition takes the form of a NULL terminated array > of descriptor field definitions

Re: [PATCH v1 4/8] lsusb: Switch to descriptor-definition based dump for UAC1 and UAC2.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:27PM +, Michael Drake wrote: > This gives us more consistency in handling of incorrect descriptor > buffer lengths, and improves whitespace/alignment consistency. > --- > Makefile.am | 2 + > lsusb.c | 779 > +

Re: [PATCH v1 5/8] lsusb: Add descriptor definitions for UAC3.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:28PM +, Michael Drake wrote: > --- > desc-defs.c | 277 > > desc-defs.h | 3 + > desc-dump.c | 5 ++ > 3 files changed, 270 insertions(+), 15 deletions(-) We need some kind of changelog text here t

Re: [PATCH v1 6/8] lsusb: Add initial support for UAC3.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:29PM +, Michael Drake wrote: > --- > lsusb.c | 52 ++-- > 1 file changed, 34 insertions(+), 18 deletions(-) Again, some changelog text please. -- To unsubscribe from this list: send the line "unsubscribe linux-usb"

Re: [PATCH v1 7/8] lsusb: Add descriptor definition for USB3 BOS Configuration Summary.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:30PM +, Michael Drake wrote: > --- > desc-defs.c | 16 > desc-defs.h | 3 +++ > 2 files changed, 19 insertions(+) Same here, some text please. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to ma

Re: [PATCH v1 8/8] lsusb: Dump USB3 BOS Configuration Summary Descriptor.

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:31PM +, Michael Drake wrote: > --- > lsusb.c | 6 ++ > 1 file changed, 6 insertions(+) And here. > > diff --git a/lsusb.c b/lsusb.c > index c9d0d74..ddc19e0 100644 > --- a/lsusb.c > +++ b/lsusb.c > @@ -75,6 +75,7 @@ > #define USB_DC_PLATFORM 0x

Re: [PATCH v1 0/8] lsusb: Add initial support for USB Audio Class 3

2017-12-05 Thread Greg KH
On Tue, Dec 05, 2017 at 04:14:23PM +, Michael Drake wrote: > This adds a new way of dumping descriptors, which splits the knowledge > of how to interpret descriptor data from the actual dumping. This has > two advantages: > > 1. It is easy to add support for new descriptors, since they are now

Re: [PATCH] xhci: Fix front USB ports on ASUS PRIME B350M-A

2017-12-05 Thread Bjorn Helgaas
[+cc Rafael, linux-pm] On Wed, Dec 06, 2017 at 12:22:42AM +0800, Kai-Heng Feng wrote: > The board in question has three XHCI HCs: > 02:00.0 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] USB 3.1 > XHCI Controller [1022:43bb] (rev 02) > 04:00.0 USB controller [0c03]: ASMedia Technology

[PATCH] tools/usbip: fixes build with musl libc toolchain

2017-12-05 Thread julien . boibessot
From: Julien BOIBESSOT Indeed musl doesn't define old SIGCLD signal name but only new one SIGCHLD. SIGCHLD is the new POSIX name for that signal so it doesn't change anything on other libcs. This fixes this kind of build error: usbipd.c: In function ‘set_signal’: usbipd.c:459:12: error: 'SIGCLD

[PATCH 0/4] UWB: Adjustments for four function implementations

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 21:17:55 +0100 A few update suggestions were taken into account from static source code analysis. Markus Elfring (4): Delete an error message for a failed memory allocation in hwarc_probe() Delete an error message for a failed memory allocation in w

[PATCH 1/4] uwb: Delete an error message for a failed memory allocation in hwarc_probe()

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 20:30:50 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/uwb/hwa-rc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 dele

[PATCH 2/4] uwb: Delete an error message for a failed memory allocation in whcrc_probe()

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 20:43:31 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/uwb/whc-rc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 dele

[PATCH 3/4] uwb/i1480/dfu/mac: Delete an error message for a failed memory allocation in fw_hdrs_load()

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 21:00:03 +0100 Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/uwb/i1480/dfu/mac.c | 4 +--- 1 file changed, 1 insertion(+), 3

[PATCH 4/4] uwb/i1480/dfu/usb: Delete two error messages for a failed memory allocation in i1480_usb_probe()

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 21:07:47 +0100 Omit extra messages for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/uwb/i1480/dfu/usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 d

[PATCH 0/2] usbip: Adjustments for two function implementations

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 22:44:55 +0100 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Delete an error message for a failed memory allocation in two functions Use common error handling code in stub_recv_cmd_submit() dr

[PATCH 1/2] usbip: Delete an error message for a failed memory allocation in two functions

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 22:25:38 +0100 Omit an extra message for a memory allocation failure in these functions. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/usb/usbip/stub_rx.c | 2 -- 1 file changed, 2 deletions(-) d

[PATCH 2/2] usbip: Use common error handling code in stub_recv_cmd_submit()

2017-12-05 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 5 Dec 2017 22:40:30 +0100 Add a jump target so that a bit of exception handling can be better reused at the end of this function. Signed-off-by: Markus Elfring --- drivers/usb/usbip/stub_rx.c | 22 ++ 1 file changed, 10 insertions(+), 12 dele

usb device implemented with functionfs - must app run as root?

2017-12-05 Thread andy_purcell
I have implemented a USB device using functionfs. A colleague now says our app must run as a normal user, not as root. I tried it and it does not work. The problem is this - the endpoint files created by the OS are owned by root. These ep files are created after I write the descriptors and strin

Re: [PATCH 1/2] usbip: Delete an error message for a failed memory allocation in two functions

2017-12-05 Thread Shuah Khan
On 12/05/2017 02:49 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 5 Dec 2017 22:25:38 +0100 > > Omit an extra message for a memory allocation failure in these functions. > > This issue was detected by using the Coccinelle software. Please include the problem and log from Cocc

Re: [PATCH 2/2] usbip: Use common error handling code in stub_recv_cmd_submit()

2017-12-05 Thread Shuah Khan
On 12/05/2017 02:52 PM, SF Markus Elfring wrote: > From: Markus Elfring > Date: Tue, 5 Dec 2017 22:40:30 +0100 > > Add a jump target so that a bit of exception handling can be better reused > at the end of this function. > > Signed-off-by: Markus Elfring > --- > drivers/usb/usbip/stub_rx.c | 2

[PATCH] USB: uas and storage: Add US_FL_BROKEN_FUA for another JMicron JMS567 ID

2017-12-05 Thread David Kozub
There is another JMS567-based USB3 UAS enclosure (152d:0578) that fails with the following error: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [sda] tag#0 Sense Key : Illegal Request [current] [sda] tag#0 Add. Sense: Invalid field in cdb The issue occurs both with UAS (occas

Re: [PATCH v4] usb: xhci: allow imod-interval to be configurable

2017-12-05 Thread Adam Wallis
Rob, On 12/5/2017 3:48 AM, Mathias Nyman wrote: > On 05.12.2017 04:54, Adam Wallis wrote: >> On 12/4/2017 9:15 PM, Chunfeng Yun wrote: >>> On Mon, 2017-12-04 at 09:27 -0500, Adam Wallis wrote: The xHCI driver currently has the IMOD set to 160, which [..] > > If Rob Acks this version I'll app

[PATCH v4 12/73] xarray: Add xa_cmpxchg

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This works like doing cmpxchg() on an array entry. Code which wants the radix_tree_insert() semantic of not overwriting an existing entry can cmpxchg() with NULL and get the action it wants. Plus, instead of having an error returned, they get the value currently stored in t

[PATCH v4 62/73] dax: Convert dax_insert_pfn_mkwrite to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/dax.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 7bd94f1b61d0..619aff70583f 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1498,21 +1498,21 @@ static int dax_insert_pfn_mkwrite(struct

[PATCH v4 70/73] xfs: Convert pag_ici_root to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Rename pag_ici_root to pag_ici_xa and use XArray APIs instead of radix tree APIs. Shorter code, typechecking on tag numbers, better error checking in xfs_reclaim_inode(), and eliminates a call to radix_tree_preload(). Signed-off-by: Matthew Wilcox --- fs/xfs/libxfs/xfs_sb

[PATCH v4 60/73] dax: Convert __dax_invalidate_mapping_entry to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Simple now that we already have an xa_state! Signed-off-by: Matthew Wilcox --- fs/dax.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index ad984dece12e..66f6c4ea18f7 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -413,24 +413,

[PATCH v4 59/73] dax: More XArray conversion

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This time, we want to convert get_unlocked_mapping_entry() to use the XArray. That has a ripple effect, causing us to change the waitqueues to hash on the address of the xarray rather than the address of the mapping (functionally equivalent), and create a lot of on-the-stack

[PATCH v4 64/73] dax: Convert grab_mapping_entry to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/dax.c | 98 +--- 1 file changed, 26 insertions(+), 72 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index de85ce87d333..c663d82e8ba3 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -44

[PATCH v4 54/73] nilfs2: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox I'm not 100% convinced that the rewrite of nilfs_copy_back_pages is correct, but it will at least have different bugs from the current version. Signed-off-by: Matthew Wilcox --- fs/nilfs2/btnode.c | 37 +++- fs/nilfs2/page.c | 72 +

[PATCH v4 61/73] dax: Convert dax_writeback_one to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Likewise easy Signed-off-by: Matthew Wilcox --- fs/dax.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 66f6c4ea18f7..7bd94f1b61d0 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -633,8 +633,7 @@ static int dax_writ

[PATCH v4 68/73] brd: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Convert brd_pages from a radix tree to an XArray. Simpler and smaller code; in particular another user of radix_tree_preload is eliminated. Signed-off-by: Matthew Wilcox --- drivers/block/brd.c | 87 ++--- 1 file changed, 23

[PATCH v4 67/73] vmalloc: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox The radix tree of vmap blocks is simpler to express as an XArray. Saves a couple of hundred bytes of text and eliminates a user of the radix tree preload API. Signed-off-by: Matthew Wilcox --- mm/vmalloc.c | 39 +-- 1 file changed, 13 in

[PATCH v4 22/73] page cache: Convert hole search to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox The page cache offers the ability to search for a miss in the previous or next N locations. Rather than teach the XArray about the page cache's definition of a miss, use xas_prev() and xas_next() to search the page array. This should be more efficient as it does not have to

[PATCH v4 69/73] xfs: Convert m_perag_tree to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Getting rid of the m_perag_lock lets us also get rid of the call to radix_tree_preload(). This is a relatively naive conversion; we could improve performance over the radix tree implementation by passing around xa_state pointers instead of indices, possibly at the expense of

[PATCH v4 65/73] dax: Fix sparse warning

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox sparse doesn't know that follow_pte_pmd conditionally acquires the ptl, so add an annotation to let it know what's going on. Signed-off-by: Matthew Wilcox --- fs/dax.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/dax.c b/fs/dax.c index c663d82e8ba3..7a86ff1153dd

[PATCH v4 66/73] page cache: Finish XArray conversion

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox With no more radix tree API users left, we can drop the GFP flags and use xa_init() instead of INIT_RADIX_TREE(). Signed-off-by: Matthew Wilcox --- fs/inode.c | 2 +- include/linux/fs.h | 2 +- mm/swap_state.c| 2 +- 3 files changed, 3 insertions(+), 3 deletion

[PATCH v4 73/73] usb: Convert xhci-mem to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox The XArray API is a slightly better fit for xhci_insert_segment_mapping() than the radix tree API was. Signed-off-by: Matthew Wilcox --- drivers/usb/host/xhci-mem.c | 70 + drivers/usb/host/xhci.h | 6 ++-- 2 files changed,

[PATCH v4 71/73] xfs: Convert xfs dquot to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a pretty straight-forward conversion. Signed-off-by: Matthew Wilcox --- fs/xfs/xfs_dquot.c | 33 + fs/xfs/xfs_qm.c| 32 fs/xfs/xfs_qm.h| 18 +- 3 files changed, 42 insertions(+

[PATCH v4 72/73] xfs: Convert mru cache to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This eliminates a call to radix_tree_preload(). Signed-off-by: Matthew Wilcox --- fs/xfs/xfs_mru_cache.c | 72 +++--- 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/fs/xfs/xfs_mru_cache.c b/fs/xfs/xfs_mru_cache.c

[PATCH v4 63/73] dax: Convert dax_insert_mapping_entry to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/dax.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 619aff70583f..de85ce87d333 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -498,9 +498,9 @@ static void *dax_insert_mapping_e

[PATCH v4 56/73] lustre: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- drivers/staging/lustre/lustre/llite/glimpse.c | 12 +--- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/g

[PATCH v4 55/73] f2fs: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a straightforward conversion. Signed-off-by: Matthew Wilcox --- fs/f2fs/data.c | 3 +-- fs/f2fs/dir.c| 5 + fs/f2fs/inline.c | 6 +- fs/f2fs/node.c | 10 ++ 4 files changed, 5 insertions(+), 19 deletions(-) diff --git a/fs/f2fs/data.c b/

[PATCH v4 58/73] dax: Convert lock_slot to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/dax.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 03bfa599f75c..d2007a17d257 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -188,15 +188,13 @@ static void dax_wake_ma

[PATCH v4 53/73] fs: Convert writeback to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox A couple of short loops. Signed-off-by: Matthew Wilcox --- fs/fs-writeback.c | 27 ++- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index a3c2352507f6..18ad86ccba96 100644 --- a/fs/fs-writebac

[PATCH v4 57/73] dax: Convert dax_unlock_mapping_entry to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Replace slot_locked() with dax_locked() and inline unlock_slot() into its only caller. Signed-off-by: Matthew Wilcox --- fs/dax.c | 50 -- 1 file changed, 16 insertions(+), 34 deletions(-) diff --git a/fs/dax.c b/fs/dax.c in

[PATCH v4 15/73] xarray: Add xa_get_entries, xa_get_tagged and xa_get_maybe_tag

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox These functions allow a range of xarray entries to be extracted into a compact normal array. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 27 lib/xarray.c | 88 ++ 2 files changed, 115

[PATCH v4 52/73] fs: Convert buffer to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Mostly comment fixes, but one use of __xa_set_tag. Signed-off-by: Matthew Wilcox --- fs/buffer.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 33c08624d45b..986b50b0fd50 100644 --- a/fs/buffer.c +++ b/fs/

[PATCH v4 18/73] xarray: Add xas_create_range

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This hopefully temporary function is useful for users who have not yet been converted to multi-index entries. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 2 ++ lib/xarray.c | 22 ++ 2 files changed, 24 insertions(+) diff --git

[PATCH v4 48/73] shmem: Convert shmem_free_swap to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a perfect use for xa_cmpxchg(). Note the use of 0 for GFP flags; we won't be allocating memory. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 768d470a03da..ca45

[PATCH v4 49/73] shmem: Convert shmem_partial_swap_usage to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Simpler code because the xarray takes care of things like the limit and dereferencing the slot. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 18 +++--- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index ca45ff493587..

[PATCH v4 50/73] shmem: Comment fixups

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Remove the last mentions of radix tree from various comments. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 01102e2e0ef3..090937922c1d 100644 --- a/mm/shmem.c ++

[PATCH v4 43/73] shmem: Convert find_swap_entry to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a 1:1 conversion. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 654f367aca90..ce285ae635ea 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1076,2

[PATCH v4 36/73] mm: Convert page migration to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/migrate.c | 40 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 59f18c571120..7122fec9b075 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -322,7

[PATCH v4 39/73] mm: Convert khugepaged_scan_shmem to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Slightly shorter and easier to read code. Signed-off-by: Matthew Wilcox --- mm/khugepaged.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 9f49d0cd61c2..15f1b2d81a69 100644 --- a/mm/khugepaged.

[PATCH v4 37/73] mm: Convert huge_memory to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Quite a straightforward conversion. Signed-off-by: Matthew Wilcox --- mm/huge_memory.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 28909c475ee5..5a41b00d86bd 100644 --- a/mm/huge_memory.

[PATCH v4 40/73] pagevec: Use xa_tag_t

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Removes sparse warnings. Signed-off-by: Matthew Wilcox --- fs/btrfs/extent_io.c| 4 ++-- fs/ext4/inode.c | 2 +- fs/f2fs/data.c | 2 +- fs/gfs2/aops.c | 2 +- include/linux/pagevec.h | 8 +--- mm/swap.c | 4 ++-- 6 files chan

[PATCH v4 28/73] page cache: Remove stray radix comment

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- mm/filemap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/filemap.c b/mm/filemap.c index 9e6158cfbaeb..79d0731b8762 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2601,7 +2601,7 @@ static struct page *do_read_cac

[PATCH v4 44/73] shmem: Convert shmem_tag_pins to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Simplify the locking by taking the spinlock while we walk the tree on the assumption that many acquires and releases of the lock will be worse than holding the lock for a (potentially) long time. We could replicate the same locking behaviour with the xarray, but would have t

[PATCH v4 41/73] shmem: Convert replace to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox shmem_radix_tree_replace() is renamed to shmem_xa_replace() and converted to use the XArray API. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index c5731bb95

[PATCH v4 46/73] shmem: Convert shmem_add_to_page_cache to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This removes the last caller of radix_tree_maybe_preload_order(). Simpler code, unless we run out of memory for new xa_nodes partway through inserting entries into the xarray. Hopefully we can support multi-index entries in the page cache soon and all the awful code goes awa

[PATCH v4 42/73] shmem: Convert shmem_confirm_swap to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox xa_load has its own RCU locking, so we can eliminate it here. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index fad6c9e7402e..654f367aca90 100644 --- a/mm/shmem.c +++ b/mm/sh

[PATCH v4 45/73] shmem: Convert shmem_wait_for_pins to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox As with shmem_tag_pins(), hold the lock around the entire loop instead of acquiring & dropping it for each entry we're going to untag. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 59 --- 1 file changed, 24 insertio

[PATCH v4 33/73] mm: Convert delete_from_swap_cache to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Both callers of __delete_from_swap_cache have the swp_entry_t already, so pass that in to make constructing the XA_STATE easier. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 5 +++-- mm/swap_state.c | 24 ++-- mm/vmscan.c | 2

[PATCH v4 51/73] btrfs: Convert page cache to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Signed-off-by: Matthew Wilcox --- fs/btrfs/compression.c | 4 +--- fs/btrfs/extent_io.c | 6 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index e687d06cd97c..4174b166e235 100644 --- a/fs/btrfs/compre

[PATCH v4 47/73] shmem: Convert shmem_alloc_hugepage to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox xa_find() is a slightly easier API to use than radix_tree_gang_lookup_slot() because it contains its own RCU locking. Signed-off-by: Matthew Wilcox --- mm/shmem.c | 13 +++-- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c ind

[PATCH v4 34/73] mm: Convert cgroup writeback to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a fairly naive conversion, leaving in place the GFP_ATOMIC allocation. By switching the locking around, we could use GFP_KERNEL and probably simplify the error handling. Signed-off-by: Matthew Wilcox --- include/linux/backing-dev-defs.h | 2 +- include/linux/back

[PATCH v4 35/73] mm: Convert __do_page_cache_readahead to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This one is trivial. Signed-off-by: Matthew Wilcox --- mm/readahead.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/readahead.c b/mm/readahead.c index f64b31b3a84a..66bcaffd47f0 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -174,9 +174,7 @

[PATCH v4 21/73] ida: Convert to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox Use the xarray infrstructure like we used the radix tree infrastructure. This lets us get rid of idr_get_free() from the radix tree code. Signed-off-by: Matthew Wilcox --- include/linux/idr.h| 8 +- include/linux/radix-tree.h | 4 - lib/idr.c |

[PATCH v4 38/73] mm: Convert collapse_shmem to XArray

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox I found another victim of the radix tree being hard to use. Because there was no call to radix_tree_preload(), khugepaged was allocating radix_tree_nodes using GFP_ATOMIC. I also converted a local_irq_save()/restore() pair to disable()/enable(). Signed-off-by: Matthew Wilc

[PATCH v4 23/73] page cache: Add page_cache_range_empty function

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox btrfs has its own custom function for determining whether the page cache has any pages in a particular range. Move this functionality to the page cache, and call it from btrfs. Signed-off-by: Matthew Wilcox --- fs/btrfs/btrfs_inode.h | 7 - fs/btrfs/inode.c|

[PATCH v4 01/73] xfs: Rename xa_ elements to ail_

2017-12-05 Thread Matthew Wilcox
From: Matthew Wilcox This is a simple rename, except that xa_ail becomes ail_head. Signed-off-by: Matthew Wilcox --- fs/xfs/xfs_buf_item.c| 10 ++-- fs/xfs/xfs_dquot.c | 4 +- fs/xfs/xfs_dquot_item.c | 11 ++-- fs/xfs/xfs_inode_item.c | 22 +++ fs/xfs/xfs_log.c |

  1   2   >