Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE

2018-08-22 Thread Benjamin Herrenschmidt
On Wed, 2018-08-22 at 22:11 -0700, Linus Torvalds wrote: > On Wed, Aug 22, 2018 at 9:54 PM Benjamin Herrenschmidt > wrote: > > > > > > So we do need a different flush instruction for the page tables vs. the > > normal TLB pages. > > Right. ARM wants

Re: [PATCH 3/4] mm/tlb, x86/mm: Support invalidating TLB caches for RCU_TABLE_FREE

2018-08-22 Thread Benjamin Herrenschmidt
On Wed, 2018-08-22 at 20:59 -0700, Linus Torvalds wrote: > On Wed, Aug 22, 2018 at 8:45 PM Nicholas Piggin wrote: > > > > powerpc/radix has no such issue, it already does this tracking. > > Yeah, I now realize that this was why you wanted to add that hacky > thing to the generic code, so that yo

Re: [PATCH v2] i2c: Remove '-Wno-deprecated-declarations' compiler warning

2018-08-20 Thread Benjamin Herrenschmidt
On Mon, 2018-08-20 at 10:06 +0200, Wolfram Sang wrote: > > > Some people still use those old machines, I'll give a try at fixing the > > driver. > > I did this here a while ago [1] ("macintosh: therm_windtunnel: drop > using attach adapter")... > > > Paul: Do you still have one of these machines

Re: [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-20 Thread Benjamin Herrenschmidt
On Mon, 2018-08-20 at 09:17 +0200, Lukas Wunner wrote: > On Mon, Aug 20, 2018 at 12:10:59PM +1000, Benjamin Herrenschmidt wrote: > > I chose to create a new mutex which we should be able to address other > > similar races if we find them. The other solutions that I dis

Re: [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-20 Thread Benjamin Herrenschmidt
On Mon, 2018-08-20 at 11:55 +0530, Hari Vyas wrote: > On Mon, Aug 20, 2018 at 7:40 AM, Benjamin Herrenschmidt > wrote: > > On Sat, 2018-08-18 at 21:24 -0500, Bjorn Helgaas wrote: > > > On Sat, Aug 18, 2018 at 01:24:51PM +1000, Benjamin Herrenschmidt wrote: > > >

Re: [PATCH v2] i2c: Remove '-Wno-deprecated-declarations' compiler warning

2018-08-19 Thread Benjamin Herrenschmidt
On Sun, 2018-08-19 at 09:46 -0700, Linus Torvalds wrote: > On Sun, Aug 19, 2018 at 6:51 AM Sedat Dilek wrote: > > > > This can be dropped with commit 771c035372a036f83353eef46dbb829780330234 > > ("deprecate the '__deprecated' attribute warnings entirely and for good") > > now in upstream. > > Co

Re: [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-19 Thread Benjamin Herrenschmidt
On Sat, 2018-08-18 at 21:24 -0500, Bjorn Helgaas wrote: > On Sat, Aug 18, 2018 at 01:24:51PM +1000, Benjamin Herrenschmidt wrote: > > On Fri, 2018-08-17 at 10:44 -0500, Bjorn Helgaas wrote: > > > On Fri, Aug 17, 2018 at 02:48:57PM +1000, Benjamin Herrenschmidt wrote: > >

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 20:15 +0200, Lukas Wunner wrote: > > The two steps (enumeration and driver attachment) are protected by > pci_lock_rescan_remove(). Initially, when a pci_dev is newly allocated > with kzalloc(), is_added is 0. The transition from 0 to 1 happens while > under pci_lock_rescan

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 11:25 -0500, Bjorn Helgaas wrote: > On Fri, Aug 17, 2018 at 02:48:58PM +1000, Benjamin Herrenschmidt wrote: > > This re-fixes the bug reported by Hari Vyas > > after my revert of his commit but in a much simpler way. > > > > The main issues is

Re: [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 10:44 -0500, Bjorn Helgaas wrote: > On Fri, Aug 17, 2018 at 02:48:57PM +1000, Benjamin Herrenschmidt wrote: > > This reverts commit 44bda4b7d26e9fffed6d7152d98a2e9edaeb2a76. > > Just to be clear, if I understand correctly, this is a pure revert of > 44bda4

Re: [PATCH] platform/x86: acer-wmi: Silence "unsupported" message a bit

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 14:27 +0300, Andy Shevchenko wrote: > On Fri, Aug 17, 2018 at 2:22 PM, Benjamin Herrenschmidt > wrote: > > On Fri, 2018-08-17 at 14:09 +0300, Andy Shevchenko wrote: > > > On Fri, Aug 17, 2018 at 2:07 PM, Andy Shevchenko > > > wrote: > >

Re: [PATCH] platform/x86: acer-wmi: Silence "unsupported" message a bit

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 14:09 +0300, Andy Shevchenko wrote: > On Fri, Aug 17, 2018 at 2:07 PM, Andy Shevchenko > wrote: > > On Thu, Aug 16, 2018 at 2:27 AM, Benjamin Herrenschmidt > > wrote: > > > This driver prints that "Unsupported machine..." message on e

Re: [RFC PATCH 5/6] pci: Protect the enable/disable state of pci_dev using the state mutex

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 15:40 +0530, Hari Vyas wrote: > > > So I'm rather dubious of adding a whole new layer of "modify" callbacks > > to config space accessors for that, especially since they won't do any > > good on architectures with lockless config accesses such as ... x86 > > > > modify() is

Re: [RFC PATCH 5/6] pci: Protect the enable/disable state of pci_dev using the state mutex

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 14:30 +0530, Hari Vyas wrote: > So many mail threads for common issues going so just trying to > summarize concern from my side. > 1) HW level > PCI Config data overwritten (ex: PCI_COMMAND bits etc) was happening > at lower layer so from my > perspective, it is best to handle

Re: [RFC PATCH 5/6] pci: Protect the enable/disable state of pci_dev using the state mutex

2018-08-17 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 10:09 +0200, Marta Rybczynska wrote: > > - On 17 Aug, 2018, at 06:49, Benjamin Herrenschmidt > b...@kernel.crashing.org wrote: > > > This protects enable/disable operations using the state mutex to > > avoid races with, for example, concur

[RFC PATCH 4/6] pci: Add a mutex to pci_dev to protect device state

2018-08-16 Thread Benjamin Herrenschmidt
x meant to protect the mapping between the state fields and the hardware state, for example enabling disabling, setting/clearing bus master etc... These operations can happen while the device_lock() is already held (but don't have to) so a separate mutex is preferable. Signed-off-by: Benjami

[RFC PATCH 6/6] pci: Protect is_busmaster using the state lock

2018-08-16 Thread Benjamin Herrenschmidt
. Signed-off-by: Benjamin Herrenschmidt --- drivers/pci/pci.c | 9 + include/linux/pci.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 68152de2b5a0..13d988d5b2a3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c

[RFC PATCH 3/6] pci: Remove priv_flags and use dev->error_state for "disconnected" status

2018-08-16 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- drivers/pci/access.c | 12 ++-- drivers/pci/msi.c| 4 ++-- drivers/pci/pci.c| 2 +- drivers/pci/pci.h| 11 ++- include/linux/pci.h | 2 -- 5 files changed, 11 insertions(+), 20 deletions(-) diff --git a/drivers/pci/access.c

[RFC PATCH v2 3/6] pci: Remove priv_flags and use dev->error_state for "disconnected" status

2018-08-16 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- v2. Initialize the io channel state before we try to read the header drivers/pci/access.c | 12 ++-- drivers/pci/msi.c| 4 ++-- drivers/pci/pci.c| 2 +- drivers/pci/pci.h| 11 ++- drivers/pci/probe.c | 4 +++- include/linux/pci.

[RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-16 Thread Benjamin Herrenschmidt
first, which also has the advantage of matching the fact that we are clearing it *after* unbinding in the remove path, thus the flag is now symtetric and always set while the driver code is running. Signed-off-by: Benjamin Herrenschmidt --- drivers/pci/bus.c | 4 ++-- 1 file changed, 2 insertions

[RFC PATCH 5/6] pci: Protect the enable/disable state of pci_dev using the state mutex

2018-08-16 Thread Benjamin Herrenschmidt
just avoid the issue alltogether, especially as we might find cases where we want to take it top-down later). Signed-off-by: Benjamin Herrenschmidt --- drivers/pci/pci.c | 51 --- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/drivers

Re: [RFC PATCH 0/6] pci: Rework is_added race fix and address bridge enable races

2018-08-16 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 14:48 +1000, Benjamin Herrenschmidt wrote: > The second part aims at fixing the enable/disable/set_master races, > and does so by providing a framework for future device state locking > issues. > > It introduces a pci_dev->state_mutex which is used at a

Re: [RFC PATCH 2/6] pci: Set pci_dev->is_added before calling device_add

2018-08-16 Thread Benjamin Herrenschmidt
s/device_add/device_attach .. ugh. On Fri, 2018-08-17 at 14:48 +1000, Benjamin Herrenschmidt wrote: > This re-fixes the bug reported by Hari Vyas > after my revert of his commit but in a much simpler way. > > The main issues is that is_added was being set after the driver >

Re: [RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-16 Thread Benjamin Herrenschmidt
On Fri, 2018-08-17 at 14:48 +1000, Benjamin Herrenschmidt wrote: > This reverts commit 44bda4b7d26e9fffed6d7152d98a2e9edaeb2a76. > > The new pci state mutex provides a simpler way of addressing > this race and avoids the relative includes added to the powerpc > code. Ignore the c

[RFC PATCH 0/6] pci: Rework is_added race fix and address bridge enable races

2018-08-16 Thread Benjamin Herrenschmidt
This is really two series but since they conflict a bit separately here they are in one: First we undo the mess of those atomic priv_flags. The atomicity doesn't provide any security since there's no locking against the other state pertaining to those flags, it only protects the flags themselves.

[RFC PATCH 1/6] Revert "PCI: Fix is_added/is_busmaster race condition"

2018-08-16 Thread Benjamin Herrenschmidt
This reverts commit 44bda4b7d26e9fffed6d7152d98a2e9edaeb2a76. The new pci state mutex provides a simpler way of addressing this race and avoids the relative includes added to the powerpc code. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/pci-common.c | 4 +--- arch

Re: [RFC PATCH] pci: Proof of concept at fixing pci_enable_device/bridge races

2018-08-16 Thread Benjamin Herrenschmidt
On Thu, 2018-08-16 at 22:07 -0500, Bjorn Helgaas wrote: > [+cc Srinath, Guenter, Jens, Lukas, Konstantin, Marta, Pierre-Yves] > > On Thu, Aug 16, 2018 at 07:50:13AM +1000, Benjamin Herrenschmidt wrote: > > [Note: This isn't meant to be merged, it need splitting at the very

Re: [RFC PATCH] pci: Proof of concept at fixing pci_enable_device/bridge races

2018-08-15 Thread Benjamin Herrenschmidt
On Wed, 2018-08-15 at 15:40 -0700, Guenter Roeck wrote: > On Thu, Aug 16, 2018 at 07:50:13AM +1000, Benjamin Herrenschmidt wrote: > > (Resent with lkml on copy) > > > > [Note: This isn't meant to be merged, it need splitting at the very > > least, see below] > &

[PATCH] platform/x86: acer-wmi: Silence "unsupported" message a bit

2018-08-15 Thread Benjamin Herrenschmidt
This driver prints that "Unsupported machine..." message on every boot on ThinkPad X1 Carbon laptops (and I assume a number of other systems), which causes graphical boots to "glitch" a bit and is rather annoying ... Make it a pr_debug instead. Signed-off-by: Benjamin Herr

[RFC PATCH] pci: Proof of concept at fixing pci_enable_device/bridge races

2018-08-15 Thread Benjamin Herrenschmidt
least within a given domain, I know we have some attempts at locking in the hotplug code for that, I'm not ready to tackle that or change it at this stage. We might be able to also addrss the is_added issues (Hari Vyas stuff) using the same mutex, I haven't looked into the details

Re: [PATCH] fsi: ast: select GENERIC_ALLOCATOR

2018-08-13 Thread Benjamin Herrenschmidt
On Tue, 2018-08-14 at 00:37 +0200, Arnd Bergmann wrote: > In randconfig builds without CONFIG_GENERIC_ALLOCATOR, this driver > fails to link: > > ERROR: "gen_pool_alloc_algo" [drivers/fsi/fsi-master-ast-cf.ko] undefined! > ERROR: "gen_pool_fixed_alloc" [drivers/fsi/fsi-master-ast-cf.ko] undefined!

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-08-08 Thread Benjamin Herrenschmidt
On Wed, 2018-08-08 at 05:30 -0700, Christoph Hellwig wrote: > On Wed, Aug 08, 2018 at 08:07:49PM +1000, Benjamin Herrenschmidt wrote: > > Qemu virtio bypasses that iommu when the VIRTIO_F_IOMMU_PLATFORM flag > > is not set (default) but there's nothing in the device-tree t

[GIT PULL] FSI fixes for 4.19

2018-08-07 Thread Benjamin Herrenschmidt
15e2a7218c2788d79c566d17cb9428c221e7: fsi: sbefifo: Bump max command length (2018-08-08 15:44:47 +1000) Benjamin Herrenschmidt (2): fsi: scom: Fix NULL dereference fsi: sbefifo: Bump max command length drivers/fsi/fsi-sbefifo.c | 39

[GIT PULL] FSI updates round 4 (last) for 4.19

2018-07-26 Thread Benjamin Herrenschmidt
8:12 +1000) ---- Benjamin Herrenschmidt (8): fsi: master-ast-cf: Fix build warnings on 64-bit platforms fsi: master-ast-cf: Mask unused bits in RTAG/RCRC fsi: master-ast-cf: Rename dump_trace() to avoid name collision fsi: Add new central chard

Re: [PATCH] fsi: master-ast-cf: Fix memory leak

2018-07-25 Thread Benjamin Herrenschmidt
On Wed, 2018-07-25 at 08:38 -0500, Gustavo A. R. Silva wrote: > In case memory resources for *fw* were allocated, release them > before return. > > Addresses-Coverity-ID: 1472044 ("Resource leak") > Fixes: 6a794a27daca ("fsi: master-ast-cf: Add new FSI master using Aspeed > ColdFire") > Signed-of

Re: [PATCH] fsi: master-ast-cf: use correct format string for size_t

2018-07-24 Thread Benjamin Herrenschmidt
On Tue, 2018-07-24 at 11:34 +0200, Arnd Bergmann wrote: > On 32-bit targets, size_t is often 'unsigned int', so printing it as %lu > causes a warning: > > drivers/fsi/fsi-master-ast-cf.c: In function 'fsi_master_acf_read': > drivers/fsi/fsi-master-ast-cf.c:609:23: error: format '%u' expects argume

Re: linux-next: build warning after merge of the fsi tree

2018-07-23 Thread Benjamin Herrenschmidt
On Tue, 2018-07-24 at 16:03 +1000, Stephen Rothwell wrote: > Hi Benjamin, > > After merging the fsi tree, today's linux-next build (x86_64 allmodconfig) > produced this warning: Ah thanks. It's a pair of missing "z" qualifiers in those dev_dbg. This normally won't show as this driver can only be

[PATCH 2/5] fsi: sbefifo: Convert to use the new chardev

2018-07-23 Thread Benjamin Herrenschmidt
: Benjamin Herrenschmidt --- drivers/fsi/fsi-sbefifo.c | 84 +-- 1 file changed, 55 insertions(+), 29 deletions(-) diff --git a/drivers/fsi/fsi-sbefifo.c b/drivers/fsi/fsi-sbefifo.c index 33a5d9a43a07..8a185f53c9d8 100644 --- a/drivers/fsi/fsi-sbefifo.c +++ b

[PATCH 5/5] fsi: Prevent multiple concurrent rescans

2018-07-23 Thread Benjamin Herrenschmidt
The bus scanning process isn't terribly good at parallel attempts at rescanning the same bus. Let's have a per-master mutex protecting the scanning process. Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-core.c | 16 ++-- drivers/fsi/fsi-master.h | 2 +

[PATCH 4/5] fsi: Add cfam char devices

2018-07-23 Thread Benjamin Herrenschmidt
and add a couple more. Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-core.c | 264 + 1 file changed, 213 insertions(+), 51 deletions(-) diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c index faa1760a5a40..dea5bd48acc5 100644 --- a/drive

[PATCH 1/5] fsi: Add new central chardev support

2018-07-23 Thread Benjamin Herrenschmidt
<16 and there's only one copy of a given unit type per chip). A single major number and a single IDA are shared for all FSI devices. This doesn't convert the FSI device drivers to use the new scheme yet, they will be converted individually. Signed-off-by: Benjamin Herrenschmidt

[PATCH 3/5] fsi: scom: Convert to use the new chardev

2018-07-23 Thread Benjamin Herrenschmidt
This converts FSI scom to use the new fsi-core controlled chardev allocator and use a real cdev instead of a miscdev. Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-scom.c | 130 + 1 file changed, 80 insertions(+), 50 deletions(-) diff --git a

[PATCH 0/5] fsi: Convert misc devs to proper chardevs and more

2018-07-23 Thread Benjamin Herrenschmidt
This converts the various FSI devices from misc dev to chardev, as there can potentially be too much of them for misc devs limited minors, and because there are some lifetime issues with the current support. This provide a common infrastructure to allocate an FSI major and distribute minors in a w

[GIT PULL] FSI updates round 3 for 4.19

2018-07-23 Thread Benjamin Herrenschmidt
IDs (2018-07-23 16:27:32 +1000) -------- Benjamin Herrenschmidt (6): devres: Add devm_of_iomap() dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device" fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire fsi: sbefifo: Fix inconsistent use of ffdc mutex

Re: [PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-07-22 Thread Benjamin Herrenschmidt
On Sat, 2018-07-21 at 09:53 +0200, Greg Kroah-Hartman wrote: > > > So I hate using kobject_get_unless_zero(), and resisted ever adding it > > > to the tree as it shows a bad locking/tree situation as you point out > > > here. But for some reason, the block developers seemed to insist they > > > ne

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-19 Thread Benjamin Herrenschmidt
On Fri, 2018-07-20 at 09:37 +0930, Andrew Jeffery wrote: > > > > Andrew, can you start with a list that shows what you expect us to need > > on our systems ? > > > > Okay, our Witherspoon and Romulus platforms containing the ASPEED AST2500 > currently need the following tuneables exposed: > >

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-18 Thread Benjamin Herrenschmidt
On Thu, 2018-07-19 at 11:58 +0930, Andrew Jeffery wrote: > > > I agree > > > that not using /dev/mem is a good thing, but there are several ways > > > you could do that independent of any DT binding. > > > > Such as ? The only other option is to have one or more kernel drivers > > that have built-

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-18 Thread Benjamin Herrenschmidt
On Wed, 2018-07-18 at 13:50 -0600, Rob Herring wrote: > > > So Rob, I think that's precisely where the disconnect is. > > > > I think we all (well hopefully) agree that those few tunables don't fit > > in any existing subystem and aren't likely to ever do (famous last > > words...). > > > > Wher

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-16 Thread Benjamin Herrenschmidt
On Mon, 2018-07-16 at 07:55 -0600, Rob Herring wrote: > If that data is one set per SoC, then i'm not that concerned having > platform-specific data in the driver. That doesn't mean the driver is > not "generic". It's still not clear to me in this thread, how much of > this is board specific, but g

Re: [PATCH v3 1/5] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device"

2018-07-16 Thread Benjamin Herrenschmidt
On Mon, 2018-07-16 at 09:33 -0600, Rob Herring wrote: > On Thu, Jul 12, 2018 at 01:48:43PM +1000, Benjamin Herrenschmidt wrote: > > This isn't per-se a real device, it's a pseudo-device that > > represents the use of the Aspeed built-in ColdFire to > > implement the

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-12 Thread Benjamin Herrenschmidt
On Thu, 2018-07-12 at 09:11 -0600, Rob Herring wrote: > On Wed, Jul 11, 2018 at 6:54 PM Andrew Jeffery wrote: > > > > Hi Rob, > > > > Thanks for the response. > > > > On Thu, 12 Jul 2018, at 05:34, Rob Herring wrote: > > > On Wed, Jul 11, 2018 at 03:01:19PM +0930, Andrew Jeffery wrote: > > > >

Re: [PATCH v3 3/5] fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire

2018-07-12 Thread Benjamin Herrenschmidt
On Thu, 2018-07-12 at 17:53 +1000, Joel Stanley wrote: > On 12 July 2018 at 13:48, Benjamin Herrenschmidt > wrote: > > The Aspeed AST2x00 can contain a ColdFire v1 coprocessor which > > is currently unused on OpenPower systems. > > > > This adds an alternative to t

[PATCH v3 1/5] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device"

2018-07-11 Thread Benjamin Herrenschmidt
vice for use on systems based on the Aspeed chips. It has most of the same properties, plus some more needed to operate the coprocessor. Signed-off-by: Benjamin Herrenschmidt --- .../bindings/fsi/fsi-master-ast-cf.txt| 36 +++ 1 file changed, 36 insertions(+) create mode 10064

[PATCH v3 3/5] fsi: master-ast-cf: Add new FSI master using Aspeed ColdFire

2018-07-11 Thread Benjamin Herrenschmidt
coprocessor and its source code can be found at https://github.com/ozbenh/cf-fsi and is system specific. Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/Kconfig |9 + drivers/fsi/Makefile |1 + drivers/fsi/cf-fsi-fw.h | 157

[PATCH v3 4/5] arm: dts: OpenPower Romulus system can use coprocessor for FSI

2018-07-11 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts b/arch/arm/boot/dts/aspeed-bmc-opp-romulus.dts index 347938673c83..4f4e42e47e3f

[PATCH v3 2/5] devres: Add devm_of_iomap()

2018-07-11 Thread Benjamin Herrenschmidt
) and not being "managed". This adds a devm_of_iomap() that provides all of these and should probably replace uses of the above in most drivers. Signed-off-by: Benjamin Herrenschmidt Reviewed-by: Linus Walleij Reviewed-by: Joel Stanley --- include/linux/device.h | 4 li

[PATCH v3 5/5] arm: dts: OpenPower Palmetto system can use coprocessor for FSI

2018-07-11 Thread Benjamin Herrenschmidt
This switches away from userspace bitbanging to kernel FSI using the coprocessor. Signed-off-by: Benjamin Herrenschmidt --- arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts | 28 ++- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-bmc-opp

[PATCH 0/5] fsi: Coldfire coprocessor offload

2018-07-11 Thread Benjamin Herrenschmidt
This series implements support for offloading the FSI protocol bitbanging to the ColdFire secondary core of the Aspeed SoCs. The result increases FSI performance by a factor of 4, and on systems that don't support async FSI clock, provide much more regular and continuous clocking which helps reliab

[GIT PULL] FSI updates round 2 for 4.19

2018-07-11 Thread Benjamin Herrenschmidt
fetch changes up to fea9cf321c916e9372874e6f2af1bf0b5beb89fb: fsi: Move various master definitions to a common header (2018-07-12 12:06:02 +1000) ---- Benjamin Herrenschmidt (17): fsi: sbefifo: Remove unneeded semicolon fsi: scom: Add mutex aro

Re: [PATCH 06/14] fsi: master-gpio: Add more tracepoints

2018-07-11 Thread Benjamin Herrenschmidt
On Thu, 2018-06-28 at 13:41 +0930, Joel Stanley wrote: > On 27 June 2018 at 08:55, Benjamin Herrenschmidt > wrote: > > This adds a few more tracepoints that have proven useful when > > debugging issues with the FSI bus. > > > > Signed-off-by: Benjamin Herrens

Re: [RFC PATCH v2 1/4] dt-bindings: misc: Add bindings for misc. BMC control fields

2018-07-11 Thread Benjamin Herrenschmidt
On Wed, 2018-07-11 at 14:04 -0600, Rob Herring wrote: > On Wed, Jul 11, 2018 at 03:01:19PM +0930, Andrew Jeffery wrote: > > Baseboard Management Controllers (BMCs) are embedded SoCs that exist to > > provide remote management of (primarily) server platforms. BMCs are > > often tightly coupled to th

Re: [PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-07-10 Thread Benjamin Herrenschmidt
On Tue, 2018-07-10 at 16:55 -0700, Linus Torvalds wrote: > On Tue, Jul 10, 2018 at 4:32 PM Benjamin Herrenschmidt > wrote: > > > > > I like that fix, which should make this patch obsolete, right? > > > > Yes, for that specific issue, but Linus seemed to think pa

Re: [PATCH v11 5/8] i2c: fsi: Add transfer implementation

2018-07-10 Thread Benjamin Herrenschmidt
On Tue, 2018-07-10 at 12:52 -0500, Eddie James wrote: > > On 07/09/2018 05:41 PM, Wolfram Sang wrote: > > > + cmd |= FIELD_PREP(I2C_CMD_ADDR, msg->addr >> 1); > > > > I just noticed this and wonder: Don't you need the LSB of the address? > > It is not the RW flag, this is encoded in msg->flags. >

Re: [PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-07-10 Thread Benjamin Herrenschmidt
On Tue, 2018-07-10 at 16:55 +0200, Greg Kroah-Hartman wrote: > On Tue, Jul 10, 2018 at 09:44:33AM +1000, Benjamin Herrenschmidt wrote: > > On Sat, 2018-07-07 at 18:48 +0200, Greg Kroah-Hartman wrote: > > > No, kobject_get() should never happen on a 0 refcount object. That >

Re: [PATCH v2 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-10 Thread Benjamin Herrenschmidt
On Tue, 2018-07-10 at 16:55 +0200, Greg Kroah-Hartman wrote: > > > +/** > > + * kobject_has_children - Returns whether a kobject has children. > > + * @kobj: the object to test > > + * > > + * This will return whether a kobject has other kobjects as children. > > + * > > + * It does NOT account fo

Re: [PATCH v2 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-09 Thread Benjamin Herrenschmidt
On Mon, 2018-07-09 at 17:33 -0700, Linus Torvalds wrote: > On Mon, Jul 9, 2018 at 5:29 PM Benjamin Herrenschmidt > wrote: > > > > For devices with a class, we create a "glue" directory between > > the parent device and the new device with the class name

Re: [PATCH] gpio: aspeed: fix compile testing warning

2018-07-09 Thread Benjamin Herrenschmidt
rror: control reaches end of non-void > function [-Werror=return-type] > > Using a plain BUG() is easier here and avoids the problem. > > Fixes: 44ddf559d579 ("gpio: aspeed: Rework register type accessors") > Signed-off-by: Arnd Bergmann Acked-by: Benjamin Herrenschm

[PATCH v2 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-09 Thread Benjamin Herrenschmidt
enhanced for this. It appears that this was in fact the intent of the function, but the implementation was wrong. Signed-off-by: Benjamin Herrenschmidt --- drivers/base/core.c | 2 ++ include/linux/kobject.h | 17 + 2 files changed, 19 insertions(+) diff --git a/drivers/bas

Re: [PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-07-09 Thread Benjamin Herrenschmidt
On Sat, 2018-07-07 at 18:51 +0200, Greg Kroah-Hartman wrote: > > > diff --git a/drivers/base/core.c b/drivers/base/core.c > > index b610816eb887..e9eff2099896 100644 > > --- a/drivers/base/core.c > > +++ b/drivers/base/core.c > > @@ -1517,11 +1517,13 @@ static struct kobject *get_device_parent(str

Re: [PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-07-09 Thread Benjamin Herrenschmidt
On Sat, 2018-07-07 at 18:48 +0200, Greg Kroah-Hartman wrote: > No, kobject_get() should never happen on a 0 refcount object. That > being said, the code does allow it, so if things are messed up, it will > happen. I think that change happened when the switch to refcount_t > occured, before then w

Re: [PATCH 11/14] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device"

2018-07-06 Thread Benjamin Herrenschmidt
On Thu, 2018-07-05 at 10:08 -0600, Rob Herring wrote: > > > It's not really a SOC block from a vendor, it's a pseudo-device in a > > way. The current one that doesn't use the coldfire offload is just > > compatible "fsi-master-gpio". > > > > I can add a vendor but what should it be ? aspeed becau

Re: [PATCH 11/14] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device"

2018-07-03 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 16:30 -0600, Rob Herring wrote: > On Wed, Jun 27, 2018 at 09:26:02AM +1000, Benjamin Herrenschmidt wrote: > > This isn't per-se a real device, it's a pseudo-device that > > represents the use of the Aspeed built-in ColdFire to > > implement the

Re: [PATCH] fsi: sbefifo: Add missing mutex_unlock

2018-07-03 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 16:21 -0500, Eddie James wrote: > There was no unlock of the FFDC mutex. > > Fixes: 9f4a8a2d7f9d ("fsi/sbefifo: Add driver for the SBE FIFO") > Signed-off-by: Eddie James Thanks. Cheers, Ben. > --- > drivers/fsi/fsi-sbefifo.c | 1 + > 1 file changed, 1 insertion(+) > >

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-03 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 08:46 -0700, Tejun Heo wrote: > Hello, > > On Tue, Jul 03, 2018 at 03:22:47PM +1000, Benjamin Herrenschmidt wrote: > > +bool kernfs_has_children(struct kernfs_node *kn) > > +{ > > + bool has_children = false; > > + struct kernfs_nod

Re: [RFC PATCH 1/4] dts: misc: Add bindings documentation for bmc-misc-ctrl

2018-07-03 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 16:31 +0200, Greg KH wrote: > On Wed, Jul 04, 2018 at 12:16:49AM +1000, Benjamin Herrenschmidt wrote: > > On Tue, 2018-07-03 at 09:50 +0200, Greg KH wrote: > > > On Tue, Jul 03, 2018 at 05:04:10PM +1000, Andrew Jeffery wrote: > > > >

Re: [PATCH -next] fsi/sbefifo: Add dependency on OF_ADDRESS

2018-07-03 Thread Benjamin Herrenschmidt
ko] undefined! > > Fixes: 9f4a8a2d7f9d ("fsi/sbefifo: Add driver for the SBE FIFO") > Cc: Benjamin Herrenschmidt > Signed-off-by: Guenter Roeck Thanks Guenter ! I'll include this into the fsi tree. (I was wondering what that kbuild report on sparc64 was abo

Re: [RFC PATCH 1/4] dts: misc: Add bindings documentation for bmc-misc-ctrl

2018-07-03 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 09:50 +0200, Greg KH wrote: > On Tue, Jul 03, 2018 at 05:04:10PM +1000, Andrew Jeffery wrote: > > Signed-off-by: Andrew Jeffery > > --- > > I can't take patches without any changelog text at all :( Greg (and replying to your other comments as well)... This is an RFC series

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Tue, 2018-07-03 at 12:39 +1000, Benjamin Herrenschmidt wrote: > On Mon, 2018-07-02 at 19:26 -0700, Linus Torvalds wrote: > > On Mon, Jul 2, 2018 at 7:15 PM Linus Torvalds > > wrote: > > > > > > It's whitespace-damaged on purpose. It's proba

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Mon, 2018-07-02 at 19:26 -0700, Linus Torvalds wrote: > On Mon, Jul 2, 2018 at 7:15 PM Linus Torvalds > wrote: > > > > It's whitespace-damaged on purpose. It's probably broken shit. DO NOT > > USE UNDER ANY CIRCUMSTANCES. Think of it more as a "something like > > this might work, but probably

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Mon, 2018-07-02 at 19:15 -0700, Linus Torvalds wrote: > On Mon, Jul 2, 2018 at 5:57 PM Benjamin Herrenschmidt > wrote: > > > > I'll have a look see if I can find a way to check that the sysfs dir is > > empty without adding that childcount, that would at lea

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Mon, 2018-07-02 at 12:24 -0700, Linus Torvalds wrote: > On Mon, Jul 2, 2018 at 3:23 AM Benjamin Herrenschmidt > wrote: > > > > Let me try one last ditch attempt to convince you using maybe a > > different perspective: this is how sysfs is intended to work and how >

Re: DMA mappings and crossing boundaries

2018-07-02 Thread Benjamin Herrenschmidt
On Mon, 2018-07-02 at 14:06 +0100, Robin Murphy wrote: .../... Thanks Robin, I was starting to depair anybody would reply ;-) > > AFAIK, dma_alloc_coherent() is defined (Documentation/DMA-API- > > HOWTO.txt) as always allocating to the next power-of-2 order, so we > > should never have the prob

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Mon, 2018-07-02 at 09:36 +1000, Benjamin Herrenschmidt wrote: > > No. See above. The reason I think your patch 2/2 is wrong is that is > > actually *breaks* the above model, exactly because of that thing that > > you hatre. > > > > The explicit removal is act

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-02 Thread Benjamin Herrenschmidt
On Sun, 2018-07-01 at 10:04 -0700, Linus Torvalds wrote: > On Sun, Jul 1, 2018 at 12:16 AM Benjamin Herrenschmidt > wrote: > > > > I suspect you didn't read it my entire argument or I wasn't clear > > enough :-) This is actually the crux of the problem: > >

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-01 Thread Benjamin Herrenschmidt
On Sun, 2018-07-01 at 10:04 -0700, Linus Torvalds wrote: > > So this is where we disagree: > > > Thus in that scenario the "last minute" kobject_release() done by the > > last kobject_put() will be effectively unprotected from for example the > > gdp_mutex (in the case of the gluedirs) or whateve

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-07-01 Thread Benjamin Herrenschmidt
On Sat, 2018-06-30 at 20:57 -0700, Linus Torvalds wrote: > On Sat, Jun 30, 2018 at 8:42 PM Benjamin Herrenschmidt > wrote: > > > > But what if something *else* still holds a reference to the kobject ? > > It could be anything really... t > > But that's fin

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-30 Thread Benjamin Herrenschmidt
(This is a resend with lkml added for background & archival purposes) On Sat, 2018-06-30 at 12:29 -0700, Linus Torvalds wrote: > On Thu, Jun 28, 2018 at 7:19 PM Benjamin Herrenschmidt > wrote: > > > > For devices with a class, we create a "glue" directory betwe

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-30 Thread Benjamin Herrenschmidt
On Sat, 2018-06-30 at 19:18 -0700, Linus Torvalds wrote: > On Sat, Jun 30, 2018 at 7:07 PM Linus Torvalds > wrote: > > > > Those locks won't protect kobj races in _general_ (ie there is no > > locking between two totally unrelated buses), but they *should* > > serialize the case of a device being

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-30 Thread Benjamin Herrenschmidt
On Sat, 2018-06-30 at 19:07 -0700, Linus Torvalds wrote: > [ Ben - feel free to post the missing emails to lkml too ] > > On Sat, Jun 30, 2018 at 6:56 PM Benjamin Herrenschmidt > wrote: > > > > On Sat, 2018-06-30 at 12:29 -0700, Linus Torvalds wrote: > > >

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-29 Thread Benjamin Herrenschmidt
On Sat, 2018-06-30 at 11:04 +1000, Benjamin Herrenschmidt wrote: > I had a look (see my other email). It's non-trivial. We can still look > into it, but from what I gathered of how sysfs works, it's based on > kernfs which doesn't have the kobjects nor access to the refer

Re: [RFC PATCH 01/14] devres: Add devm_of_iomap()

2018-06-29 Thread Benjamin Herrenschmidt
On Fri, 2018-06-29 at 23:27 +0300, Andy Shevchenko wrote: > On Fri, Jun 29, 2018 at 12:14 PM, Linus Walleij > wrote: > > > I wonder if it is easy to find these cases and replace them with > > this neat function... > > Would be reasonable easy by using coccinelle. For the obvious ones yes. A lot

Re: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-29 Thread Benjamin Herrenschmidt
On Fri, 2018-06-29 at 06:56 -0700, Linus Torvalds wrote: > On Thu, Jun 28, 2018 at 7:22 PM Benjamin Herrenschmidt > wrote: > > > > This fixes it by instead doing an explicit kobject_del() when > > the glue dir is empty, by keeping track of the number of > > child de

[PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier

2018-06-28 Thread Benjamin Herrenschmidt
s empty, by keeping track of the number of child devices of the gluedir. This is made easy by the fact that all glue dir operations are done with a global mutex, and there's already a function (cleanup_glue_dir) called in all the right places taking that mutex that can be enhanced for

[PATCH 1/2] drivers: core: Don't try to use a dead glue_dir

2018-06-28 Thread Benjamin Herrenschmidt
tely. Signed-off-by: Benjamin Herrenschmidt --- (Adding lkml, I just realized I completely forgot to CC it in the first place on this whole conversation, blame the 1am debugging session) drivers/base/core.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/b

[PATCH 14/14] arm: dts: OpenPower Palmetto system can use coprocessor for FSI

2018-06-26 Thread Benjamin Herrenschmidt
This switches away from userspace bitbanging to kernel FSI using the coprocessor. Signed-off-by: Benjamin Herrenschmidt --- arch/arm/boot/dts/aspeed-bmc-opp-palmetto.dts | 31 ++- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/arch/arm/boot/dts/aspeed-bmc-opp

[PATCH 09/14] fsi: master-gpio: Add missing release function

2018-06-26 Thread Benjamin Herrenschmidt
: Benjamin Herrenschmidt --- drivers/fsi/fsi-master-gpio.c | 28 +--- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index 91d89597784a..bad7951a2677 100644 --- a/drivers/fsi/fsi-master-gpio.c

[PATCH 05/14] fsi: master-gpio: Add support for link_config

2018-06-26 Thread Benjamin Herrenschmidt
To configure the send and echo delays Signed-off-by: Benjamin Herrenschmidt --- drivers/fsi/fsi-master-gpio.c | 27 +-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/fsi/fsi-master-gpio.c b/drivers/fsi/fsi-master-gpio.c index 836587701ceb

[PATCH 11/14] dt-bindings: fsi: Document binding for the fsi-master-ast-cf "device"

2018-06-26 Thread Benjamin Herrenschmidt
vice for use on systems for which a corresponding firmware file exists. It has most of the same properties, plus some more needed to operate the coprocessor. Signed-off-by: Benjamin Herrenschmidt --- .../bindings/fsi/fsi-master-ast-cf.txt| 36 +++ 1 file changed, 36 insertions(

[PATCH 03/14] fsi: Add mechanism to set the tSendDelay and tEchoDelay values

2018-06-26 Thread Benjamin Herrenschmidt
d supports the new link_config() callback to configure the generation of those delays. Signed-off-by: Benjamin Herrenschmidt --- --- drivers/fsi/fsi-core.c | 109 --- drivers/fsi/fsi-master.h | 2 + 2 files changed, 93 insertions(+), 18 deletions(-) di

[PATCH 03/14] fsi: Add mechanism to set the tSendDelay and tEchoDelay values

2018-06-26 Thread Benjamin Herrenschmidt
d supports the new link_config() callback to configure the generation of those delays. Signed-off-by: Benjamin Herrenschmidt --- --- drivers/fsi/fsi-core.c | 109 --- drivers/fsi/fsi-master.h | 2 + 2 files changed, 93 insertions(+), 18 deletions(-) di

<    1   2   3   4   5   6   7   8   9   10   >