[PATCH v6 24/99] page cache: Add and replace pages using the XArray

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Use the XArray APIs to add and replace pages in the page cache. This removes two uses of the radix tree preload API and is significantly shorter code. Signed-off-by: Matthew Wilcox --- include/linux/swap.h | 8 ++- mm/filemap.c | 143 ++--

[PATCH v6 23/99] page cache: Add page_cache_range_empty function

2018-01-17 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 v6 21/99] xarray: Add xa_reserve and xa_release

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This function simply creates a slot in the XArray for users which need to acquire multiple locks before storing their entry in the tree and so cannot use a plain xa_store(). Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 14 ++ lib/xarra

[PATCH v6 20/99] ida: Convert to XArray

2018-01-17 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 v6 00/99] XArray version 6

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This version of the XArray has no known bugs. I have converted the radix tree test suite entirely over to the XArray and fixed all bugs that it has uncovered. There are additional tests in the test suite for the XArray, so I now claim the XArray has better test coverage tha

[PATCH v6 19/99] idr: Convert to XArray

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox The IDR distinguishes between unallocated entries (read as NULL) and entries where the user has chosen to store NULL. The radix tree was modified to consider NULL entries which had tag 0 _clear_ as being allocated, but it added a lot of complexity. Instead, the XArray has a

[PATCH v6 18/99] xarray: Add ability to store errno values

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox While the radix tree offers no ability to store IS_ERR pointers, documenting that the XArray does not led to some concern. Here is a sanctioned way to store errnos in the XArray. I'm concerned that it will confuse people who can't tell the difference between xa_is_err() and

[PATCH v6 17/99] xarray: Add MAINTAINERS entry

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Add myself as XArray and IDR maintainer. Signed-off-by: Matthew Wilcox --- MAINTAINERS | 12 1 file changed, 12 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 18994806e441..55ae4c0b38d5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -14893,6 +14893

[PATCH v6 16/99] xarray: Add xas_create_range

2018-01-17 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 v6 14/99] xarray: Add xa_destroy

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This function frees all the internal memory allocated to the xarray and reinitialises it to be empty. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 1 + lib/xarray.c | 26 ++ 2 files changed, 27 insertions(+) diff --git a/in

[PATCH v6 15/99] xarray: Add xas_next and xas_prev

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox These two functions move the xas index by one position, and adjust the rest of the iterator state to match it. This is more efficient than calling xas_set() as it keeps the iterator at the leaves of the tree instead of walking the iterator from the root each time. Signed-of

[PATCH v6 13/99] xarray: Add xa_extract

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This function combines the functionality of radix_tree_gang_lookup() and radix_tree_gang_lookup_tagged(). It extracts entries matching the specified filter into a normal array. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 2 ++ lib/xarray.c | 80 +

[PATCH v6 11/99] xarray: Add xa_cmpxchg and xa_insert

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Like cmpxchg(), xa_cmpxchg will only store to the index if the current entry matches the old entry. It returns the current entry, which is usually more useful than the errno returned by radix_tree_insert(). For the users who really only want the errno, the xa_insert() wrappe

[PATCH v6 12/99] xarray: Add xa_for_each

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This iterator allows the user to efficiently walk a range of the array, executing the loop body once for each entry in that range that matches the filter. This commit also includes xa_find() and xa_find_above() which are helper functions for xa_for_each() but may also be use

[PATCH v6 08/99] xarray: Add xa_load

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This first function in the XArray API brings with it a lot of support infrastructure. The advanced API is based around the xa_state which is a more capable version of the radix_tree_iter. As the test-suite demonstrates, it is possible to use the xarray and radix tree APIs o

[PATCH v6 09/99] xarray: Add xa_get_tag, xa_set_tag and xa_clear_tag

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox XArray tags are slightly more strongly typed than the radix tree tags, but occupy the same bits. This commit also adds the xas_ family of tag operations, for cases where the caller is already holding the lock, and xa_tagged() to ask whether any array member has a particular

[PATCH v6 10/99] xarray: Add xa_store

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox xa_store() differs from radix_tree_insert() in that it will overwrite an existing element in the array rather than returning an error. This is the behaviour which most users want, and those that want more complex behaviour generally want to use the xas family of routines any

[PATCH v6 07/99] xarray: Add documentation

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This is documentation on how to use the XArray, not details about its internal implementation. Signed-off-by: Matthew Wilcox --- Documentation/core-api/index.rst | 1 + Documentation/core-api/xarray.rst | 361 ++ 2 files changed, 362

[PATCH v6 06/99] xarray: Define struct xa_node

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_node. A couple of struct members have changed name, so convert those. Use a #define so that radix tree users continue to work without change. Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h| 29 +

[PATCH v6 05/99] xarray: Add definition of struct xarray

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox This is a direct replacement for struct radix_tree_root. Some of the struct members have changed name; convert those, and use a #define so that radix_tree users continue to work without change. Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h | 3

[PATCH v6 02/99] page cache: Use xa_lock

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Remove the address_space ->tree_lock and use the xa_lock newly added to the radix_tree_root. Rename the address_space ->page_tree to ->pages, since we don't really care that it's a tree. Take the opportunity to rearrange the elements of address_space to pack them better on

[PATCH v6 04/99] xarray: Change definition of sibling entries

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Instead of storing a pointer to the slot containing the canonical entry, store the offset of the slot. Produces slightly more efficient code (~300 bytes) and simplifies the implementation. Signed-off-by: Matthew Wilcox --- include/linux/xarray.h | 90 +

[PATCH v6 03/99] xarray: Replace exceptional entries

2018-01-17 Thread Matthew Wilcox
From: Matthew Wilcox Introduce xarray value entries to replace the radix tree exceptional entry code. This is a slight change in encoding to allow the use of an extra bit (we can now store BITS_PER_LONG - 1 bits in a value entry). It is also a change in emphasis; exceptional entries are intimida

Re: [PATCH v6 20/99] ida: Convert to XArray

2018-01-17 Thread John Paul Adrian Glaubitz
Hi Matthew! On 01/17/2018 09:20 PM, Matthew Wilcox wrote: > 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. There's a typo: infrstructure => infratructure Cheers, Adrian -- .''`. John Paul Adrian Glau

[PATCH] usb: dwc3: Undo PHY init if soft reset fails

2018-01-17 Thread Brian Norris
In this function, we init the USB2 and USB3 PHYs, but if soft reset times out, we don't unwind this. Noticed by inspection. Signed-off-by: Brian Norris --- drivers/usb/dwc3/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0783

Re: [PATCH] usb: dwc3: core: power on PHYs before initializing core

2018-01-17 Thread Brian Norris
On Fri, Jan 12, 2018 at 12:00:16PM +0800, William Wu wrote: > The dwc3_core_init() gets the PHYs and initializes the PHYs with > the usb_phy_init() and phy_init() functions before initializing > core, and power on the PHYs after core initialization is done. > > However, some platforms (e.g. Rockch

[PATCH 4.9] usbip: fix warning in vhci_hcd_probe/lockdep_init_map

2018-01-17 Thread Shuah Khan
commit 918b8ac55b6c809b70aa05c279087109584e393e upstream vhci_hcd calls sysfs_create_group() with dynamically allocated sysfs attributes triggering the lock-class key not persistent warning. Call sysfs_attr_init() for dynamically allocated sysfs attributes to fix it. vhci_hcd vhci_hcd: USB/IP Vir

Re: Not work 802.11ac WLAN Adapter

2018-01-17 Thread Arend van Spriel
On 1/17/2018 9:47 PM, Cristian wrote: Hello, Open bug in launchpad.net https://bugs.launchpad.net/bugs/1743872 dmesg_4.15.0-041500rc8-generic dmesg: [ 104.468231] usb 3-2: new high-speed USB device number 4 using xhci_hcd [ 104.616570] usb 3-2: New USB device found, idVendor=0bda, idProduct=a8

RE: [PATCH] usb: phy: mxs: Do not run charger detection on i.MX23/28

2018-01-17 Thread Jun Li
Unable to handle kernel NULL pointer dereference at virtual > address 0188 > [2.244195] pgd = (ptrval) > [2.246994] [0188] *pgd= > [2.250676] Internal error: Oops: 5 [#1] ARM > [2.254979] Modules linked in: > [ 2.258089] CPU: 0 PID: 1 C

Re: [PATCH v2] usb: ehci-omap: don't complain on -EPROBE_DEFER when no PHY found

2018-01-17 Thread Jaejoong Kim
In you commit message, there is a typo "when when" 2018-01-17 22:41 GMT+09:00 Roger Quadros : > On 17/01/18 12:08, Ladislav Michl wrote: >> Don't complain on -EPROBE_DEFER when when no PHY found, the driver thanks, jaej

[PATCH v3 00/15] usb: dwc3: Add new updates for DWC_usb31

2018-01-17 Thread Thinh Nguyen
This patch series adds new updates and some fixes for DWC_usb31. Changes in v3: - Add "usb: dwc3: Check controller type before setting speed" to series Changes in v2: - Add another patch to the series to increase mass_storage max_speed - Separate "usb: dwc3: ep0: Reset TRB counter for ep0 IN"

[PATCH v3 01/15] usb: dwc3: Add SoftReset PHY synchonization delay

2018-01-17 Thread Thinh Nguyen
>From DWC_usb31 databook section 1.3.2, once DWC3_DCTL_CSFTRST bit is cleared, we must wait at least 50ms before accessing the PHY domain (synchronization delay). Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --g

[PATCH v3 02/15] usb: core: urb: Check SSP isoc ep comp descriptor

2018-01-17 Thread Thinh Nguyen
The maximum bytes per interval for USB SuperSpeed Plus can be set by isoc endpoint companion descriptor when it is above 48K. If the descriptor is provided, then use its value. USB 3.1 spec 9.6.8 Signed-off-by: Thinh Nguyen --- drivers/usb/core/urb.c | 8 1 file changed, 8 insertions(+

[PATCH v3 03/15] usb: dwc3: Update DWC_usb31 GTXFIFOSIZ reg fields

2018-01-17 Thread Thinh Nguyen
Update two GTXFIFOSIZ bit fields for the DWC_usb31 controller. TXFDEP is a 15-bit value instead of 16-bit value, and bit 15 is TXFRAMNUM. The GTXFIFOSIZ register for DWC_usb31 is as follows: +---+---+--+ | BITS | Name | Description

[PATCH v3 04/15] usb: dwc3: Check IP revision for GTXFIFOSIZ

2018-01-17 Thread Thinh Nguyen
DWC_usb31 controller has different GTXFIFOSIZE bit field for TXFDEF. Check for DWC_usb31 IP revision to read the appropriate bit fields. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/d

[PATCH v3 05/15] usb: dwc3: Add DWC_usb31 GRXTHRCFG bit fields

2018-01-17 Thread Thinh Nguyen
Add new GRXTHRCFG bit field macros for DWC_usb31. The GRXTHRCFG register fields for DWC_usb31 is as follows: +---+--+--+ | BITS | Name | Description | +===+==+===

[PATCH v3 06/15] usb: dwc3: gadget: Check IP revision for GRXTHRCFG

2018-01-17 Thread Thinh Nguyen
DWC_usb31 controller has a different UsbRxPktCnt bit fields from GRXTHRCFG register. Check for DWC_usb31 IP revision to read the appropriate value. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/

[PATCH v3 07/15] usb: dwc3: Add DWC_usb31 GTXTHRCFG reg fields

2018-01-17 Thread Thinh Nguyen
Add new GTXTHRCFG bit field macros for DWC_usb31. The GTXTHRCFG register fields for DWC_usb31 is as follows: +---+--+---+ | BITS | Name | Description | +===+==+=

[PATCH v3 09/15] usb: dwc3: Check for ESS TX/RX threshold config

2018-01-17 Thread Thinh Nguyen
Check and configure TX/RX threshold for DWC_usb31. Update dwc3 structure with new fields to store these threshold configurations. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 55 + drivers/usb/dwc3/core.h | 8 +++ 2 files changed,

[PATCH v3 11/15] usb: dwc3: Track DWC_usb31 VERSIONTYPE

2018-01-17 Thread Thinh Nguyen
Add a new field to dwc3 structure to track VERSIONTYPE. The VERSIONTYPE is represented in ASCII in the 32-bit VERSIONTYPE register. In DWC_usb31, sub releases for each version are tracked with VERSIONTYPE such as "ea01" and "ea02". Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 ++

[PATCH v3 10/15] usb: dwc3: Dump LSP and BMU debug info

2018-01-17 Thread Thinh Nguyen
Dump LSP and BMU debug info. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/core.h| 5 + drivers/usb/dwc3/debugfs.c | 5 + 2 files changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index e53ae6038bbe..fd794972802d 100644 --- a/drivers/usb/dwc

[PATCH v3 08/15] usb: dwc3: Make TX/RX threshold configurable

2018-01-17 Thread Thinh Nguyen
DWC_usb31 periodic transfer at 48K+ bytes per interval may need modification to the TX/RX packet threshold to achieve optimal result. Add properties to make it configurable. Cc: John Youn Signed-off-by: Thinh Nguyen --- Documentation/devicetree/bindings/usb/dwc3.txt | 4 1 file changed, 4

[PATCH v3 12/15] usb: dwc3: Add disabling of start_transfer failure quirk

2018-01-17 Thread Thinh Nguyen
In DWC_usb31 version 1.70a-ea06 and prior needs a SW workaround for isoc START TRANSFER command failure. However, some affected versions may have RTL patches to fix this without a SW workaround. Add this quirk to disable the SW workaround when it is not needed. Synopsys STAR 9001202023: Wrong micr

[PATCH v3 14/15] usb: dwc3: Check controller type before setting speed

2018-01-17 Thread Thinh Nguyen
DWC_usb3 speed can only be set up to SuperSpeed. Limit the setting to SuperSpeed only should the value be higher. Otherwise, the controller will read an invalid speed value and set the device to an incorrect speed. Signed-off-by: Thinh Nguyen --- drivers/usb/dwc3/gadget.c | 5 - 1 file chang

[PATCH v3 13/15] usb: dwc3: Add workaround for isoc start transfer failure

2018-01-17 Thread Thinh Nguyen
In DWC_usb31 version 1.70a-ea06 and prior, for highspeed and fullspeed isochronous IN, BIT[15:14] of the 16-bit microframe number reported by the XferNotReady event are invalid. The driver uses this number to schedule the isochronous transfer and passes it to the START TRANSFER command. Because thi

[PATCH v3 15/15] usb: gadget: mass_storage: Set max_speed to SSP

2018-01-17 Thread Thinh Nguyen
Increase max_speed of the mass_storage driver for UDCs that support SuperSpeed Plus. The composite driver will pass this value to UDC core to set the device speed on probe (actual speed may be different depending on whether the USB controller supports it or other external factors). Signed-off-by:

[PATCH v2] usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28

2018-01-17 Thread Fabio Estevam
s 0188 [2.244195] pgd = (ptrval) [2.246994] [0188] *pgd= [2.250676] Internal error: Oops: 5 [#1] ARM [2.254979] Modules linked in: [2.258089] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc8-next-20180117-2-g75d5f21 #7 [2.266724] Hardware name: Fre

RE: [PATCH v2] usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28

2018-01-17 Thread Peter Chen
irtual > address > 0188 > [2.244195] pgd = (ptrval) > [2.246994] [0188] *pgd= > [2.250676] Internal error: Oops: 5 [#1] ARM > [2.254979] Modules linked in: > [2.258089] CPU: 0 PID: 1 Comm: swapper Not tainted > 4.15.0-rc8-next-20180117

Re: [PATCH] usb: option: Add support for FS040U modem

2018-01-17 Thread Johan Hovold
On Tue, Jan 16, 2018 at 09:51:17AM +, OKAMOTO Yoshiaki wrote: > FS040U modem is manufactured by omega, and sold by Fujisoft. This patch > adds ID of the modem to use option1 driver. Interface 3 is used as > qmi_wwan, so the interface is ignored. > > Signed-off-by: Yoshiaki Okamoto > Signed-of

RE: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-17 Thread Hayes Wang
[...] > > r8153 on Dell TB15/16 dock corrupts rx packets. > > > > This change is suggested by Realtek. They guess that the XHCI > > controller doesn't have enough buffer, and their guesswork is correct, > > once the RX aggregation gets disabled, the issue is gone. > > > > ASMedia is currently worki

Re: [PATCH v3] USB: serial: option: add id for Motorola Solutions TETRA PEI

2018-01-17 Thread Johan Hovold
On Tue, Jan 16, 2018 at 12:12:33AM +0100, Max Schulze wrote: > > > This indicates that option isn't the right driver for this for device. > > > > I think we should add a new simple driver for it instead, which reports > > that modem control isn't (yet) supported (yes, your python script would > >

Re: [PATCH v2] r8152: disable RX aggregation on Dell TB16 dock

2018-01-17 Thread Kai Heng Feng
> On 18 Jan 2018, at 11:04 AM, Hayes Wang wrote: > > [...] >>> r8153 on Dell TB15/16 dock corrupts rx packets. >>> >>> This change is suggested by Realtek. They guess that the XHCI >>> controller doesn't have enough buffer, and their guesswork is correct, >>> once the RX aggregation gets disabl

[PATCH] USB: serial: simple: add Motorola Tetra driver

2018-01-17 Thread Johan Hovold
Add new Motorola Tetra (simple) driver for Motorola Solutions TETRA PEI devices. D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=0cad ProdID=9011 Rev=24.16 S: Manufacturer=Motorola Solutions Inc. S: Product=Motorola Solutions TETRA PEI interface C: #Ifs= 2 Cfg#= 1 Atr=80

RE: [PATCH v2] usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28

2018-01-17 Thread Jun Li
e > [2.235659] Unable to handle kernel NULL pointer dereference at virtual > address 0188 > [2.244195] pgd = (ptrval) > [2.246994] [0188] *pgd= > [2.250676] Internal error: Oops: 5 [#1] ARM > [2.254979] Modules linked in: > [2.25808

Re: [PATCH v1 1/1] usb: xhci: do not create and register shared_hcd when USB3.0 is disabled

2018-01-17 Thread Tung Vuong Nguyen
On Tue, Jan 16, 2018 at 9:50 PM, Mathias Nyman wrote: > > Hi, Sorry about the delay > > > On 04.01.2018 07:17, Thang Q. Nguyen wrote: >> >> Hi, >> >> On Sat, Dec 16, 2017 at 10:45 AM, Thang Q. Nguyen wrote: >>> >>> From: Tung Nguyen >>> >>> Currently, hcd->shared_hcd always creates and registers

<    1   2