[PATCH v2 09/28] thunderbolt: Cache adapter specific capability offset into struct port

2019-02-06 Thread Mika Westerberg
The adapter specific capability either is there or not if the port does not hold an adapter. Instead of always finding it on-demand we read the offset just once when the port is initialized. While there we update the struct port documentation to follow kernel-doc format. Signed-off-by: Mika

[PATCH v2 11/28] thunderbolt: Generalize tunnel creation functionality

2019-02-06 Thread Mika Westerberg
tb_pci_port_active() to switch.c (and rename it) where we will be keeping all port and switch related functions. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 13 ++ drivers/thunderbolt/tb.c | 30 ++-- drivers/thunderbolt/tb.h | 2 + drivers/thunderbolt/tb_regs.h | 4

[PATCH v2 03/28] thunderbolt: Enable TMU access when accessing port space on legacy devices

2019-02-06 Thread Mika Westerberg
Light Ridge and Eagle Ridge both need to have TMU access enabled before port space can be fully accessed so make sure it happens on those. This allows us to get rid of the offset quirk in tb_port_find_cap(). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/cap.c | 74

[PATCH v2 12/28] thunderbolt: Add functions for allocating and releasing hop IDs

2019-02-06 Thread Mika Westerberg
be used to allocate and release hop IDs for a given port. While there remove obsolete TODO comment. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 87 +++- drivers/thunderbolt/tb.h | 8 2 files changed, 94 insertions(+), 1 deletion

[PATCH v2 14/28] thunderbolt: Extend tunnel creation to more than 2 adjacent switches

2019-02-06 Thread Mika Westerberg
creation of the tunnel. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c | 94 ++-- drivers/thunderbolt/tb.h | 4 +- drivers/thunderbolt/tunnel.c | 54 + 3 files changed, 106 insertions(+), 46 deletions(-) diff --git a

[PATCH v2 05/28] thunderbolt: Move LC specific functionality into a separate file

2019-02-06 Thread Mika Westerberg
We will be adding more link controller functionality in subsequent patches and it does not make sense to keep all that in switch.c, so separate LC functionality into its own file. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/Makefile | 2 +- drivers/thunderbolt/lc.c | 21

[PATCH v2 08/28] thunderbolt: Properly disable path

2019-02-06 Thread Mika Westerberg
we are trying to get rid of them but we can clean them up another day. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c| 44 --- drivers/thunderbolt/tb_regs.h | 3 ++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v2 00/28] thunderbolt: Software connection manager improvements

2019-02-06 Thread Mika Westerberg
llows cap_phy. * Use correct PCI IDs (_BRIDGE) in the last patch where we start firmware on Titan Ridge. It wrongly used NHI PCI IDs in v1. Mika Westerberg (28): net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending thunderbolt: Do not allocate switch if dep

Re: [PATCH v3] Documentation: acpi: Add an example for PRP0001

2019-03-26 Thread Mika Westerberg
On Mon, Mar 25, 2019 at 04:53:38PM +, Thomas Preston wrote: > Add an example for the magic PRP0001 device ID which allows matching > ACPI devices against drivers using OF Device Tree compatible property. > > Signed-off-by: Thomas Preston Acked-by: Mika Westerberg

Re: [PATCH] pinctrl: intel: save HOSTSW_OWN register over suspend/resume

2019-03-27 Thread Mika Westerberg
+Andy On Wed, Mar 27, 2019 at 04:22:04PM +0800, Daniel Drake wrote: > Hi Mika, > > Digging up this old thread again... > > On Tue, Nov 21, 2017 at 8:13 PM Mika Westerberg > wrote: > > > > On Tue, Nov 21, 2017 at 07:54:26PM +0800, Chris Chiu wrote: > &g

Re: [PATCH] pinctrl: intel: save HOSTSW_OWN register over suspend/resume

2019-03-28 Thread Mika Westerberg
On Wed, Mar 27, 2019 at 07:29:40PM +0200, Mika Westerberg wrote: > I wonder if it would be simpler to save it always and then upon resume > compare them and if changed, log this in dmesg and restore the saved > one. Actually I think better is to restore hostsw_own only for GPIOs that ar

Re: [PATCH v2] thunderbolt: property: fix a missing check of kzalloc

2019-03-28 Thread Mika Westerberg
On Mon, Mar 25, 2019 at 03:23:08PM -0500, Kangjie Lu wrote: > No check is enforced for the return value of kzalloc, > which may lead to NULL-pointer dereference. > > The patch fixes this issue. > > Signed-off-by: Kangjie Lu > Reviewed-by: Mukesh Ojha Applied, thanks!

Re: [PATCH v3] thunderbolt: Fix to check the return value of kmemdup

2019-03-28 Thread Mika Westerberg
On Mon, Mar 25, 2019 at 04:25:22PM -0500, Aditya Pakki wrote: > uuid in add_switch is allocted via kmemdup which can fail. The patch > logs the error and cleans up the allocated memory for switch. > > Signed-off-by: Aditya Pakki Applied, thanks!

Re: [PATCH] pinctrl: intel: save HOSTSW_OWN register over suspend/resume

2019-03-28 Thread Mika Westerberg
On Thu, Mar 28, 2019 at 08:19:59PM +0800, Chris Chiu wrote: > On Thu, Mar 28, 2019 at 5:38 PM Daniel Drake wrote: > > > > On Thu, Mar 28, 2019 at 5:17 PM Andy Shevchenko > > wrote: > > > Hmm... Can you confirm that laptop you declared as a fixed case and the > > > mentioned here is the same one?

[PATCH v3 34/36] thunderbolt: Make rest of the logging to happen at debug level

2019-03-28 Thread Mika Westerberg
). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/ctl.c| 2 +- drivers/thunderbolt/icm.c| 2 +- drivers/thunderbolt/path.c | 6 +++--- drivers/thunderbolt/switch.c | 19 +-- drivers/thunderbolt/tb.c | 11 +-- drivers/thunderbolt/tunnel.c | 6 ++ 6

[PATCH v3 19/36] thunderbolt: Extend tunnel creation to more than 2 adjacent switches

2019-03-28 Thread Mika Westerberg
-code creation of the tunnel. While there add name to struct tb_path to make debugging easier. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c | 121 ++- drivers/thunderbolt/tb.h | 5 +- drivers/thunderbolt/tunnel.c | 56 3

[PATCH v3 26/36] thunderbolt: Add support for Display Port tunnels

2019-03-28 Thread Mika Westerberg
port has HPD set before tunnels can be established. This adds Display Port tunneling support to the software connection manager. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 111 ++ drivers/thunderbolt/tb.c | 129 +--- drivers/thunderbolt/tb.h

[PATCH v3 24/36] thunderbolt: Generalize port finding routines to support all port types

2019-03-28 Thread Mika Westerberg
We will be needing these routines to find Display Port adapters as well so modify them to take port type as the second parameter. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 16 drivers/thunderbolt/tb.c | 35 +-- drivers

[PATCH v3 15/36] thunderbolt: Generalize tunnel creation functionality

2019-03-28 Thread Mika Westerberg
tb_pci_port_active() to switch.c (and rename it) where we will be keeping all port and switch related functions. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 13 ++ drivers/thunderbolt/tb.c | 30 ++-- drivers/thunderbolt/tb.h | 2 + drivers/thunderbolt/tb_regs.h | 4

[PATCH v3 17/36] thunderbolt: Assign remote for both ports in case of dual link

2019-03-28 Thread Mika Westerberg
tb_port_has_remote() that returns true only for the primary port. We also update tb_is_upstream_port() to support both dual link ports, make it take const port pointer and move it below tb_upstream_port() to keep similar functions close. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c

[PATCH v3 12/36] thunderbolt: Properly disable path

2019-03-28 Thread Mika Westerberg
we are trying to get rid of them but we can clean them up another day. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c| 48 --- drivers/thunderbolt/tb_regs.h | 3 ++- 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/drivers

[PATCH v3 09/36] thunderbolt: Move LC specific functionality into a separate file

2019-03-28 Thread Mika Westerberg
We will be adding more link controller functionality in subsequent patches and it does not make sense to keep all that in switch.c, so separate LC functionality into its own file. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/Makefile | 2 +- drivers/thunderbolt/lc.c | 21

Re: [PATCH v3 19/36] thunderbolt: Extend tunnel creation to more than 2 adjacent switches

2019-04-08 Thread Mika Westerberg
On Sun, Apr 07, 2019 at 06:54:25PM +0200, Lukas Wunner wrote: > On Thu, Mar 28, 2019 at 03:36:16PM +0300, Mika Westerberg wrote: > > +struct tb_path *tb_path_alloc(struct tb *tb, struct tb_port *src, int > > src_hopid, > > + struct tb_port *dst, int d

Re: [PATCH] pinctrl:intel: Retain HOSTSW_OWN for requested gpio pin

2019-04-08 Thread Mika Westerberg
On Mon, Apr 08, 2019 at 12:21:03PM +0800, Chris Chiu wrote: > +static void > +intel_gpio_update_pad_mode(void __iomem *hostown, u32 mask, u32 value) > +{ > + u32 curr = readl(hostown); > + u32 updated = (curr & ~mask) | (value & mask); I think here we should first complain if the expected

Re: [PATCH] intel-lpss: Set the device in reset state when init

2019-04-08 Thread Mika Westerberg
t; handlers: > [<0d3fa913>] idma64_irq > Disabling IRQ #27 > > To avoid interrupt storm, set the device in reset state > before bringing out the device from reset state. > > Signed-off-by: Binbin Wu I think the correct subject line should be: "mfd: intel-lpss: Set the device in reset state when init" Regardless of that, Acked-by: Mika Westerberg

Re: [PATCH v3 19/36] thunderbolt: Extend tunnel creation to more than 2 adjacent switches

2019-04-08 Thread Mika Westerberg
On Mon, Apr 08, 2019 at 10:53:37AM +0200, Lukas Wunner wrote: > Hm, what other cases are there, i.e. what is the meaning of a tb_regs_hop's > "next_hop" field if "out_port" doesn't have a remote? (And why does it > need to be tracked on the out_port? In case a remote is added later?) We also nee

Re: [PATCH v3 19/36] thunderbolt: Extend tunnel creation to more than 2 adjacent switches

2019-04-08 Thread Mika Westerberg
On Mon, Apr 08, 2019 at 11:49:04AM +0200, Lukas Wunner wrote: > On Mon, Apr 08, 2019 at 12:07:44PM +0300, Mika Westerberg wrote: > > On Mon, Apr 08, 2019 at 10:53:37AM +0200, Lukas Wunner wrote: > > > Hm, what other cases are there, i.e. what is the meaning of a &

Re: [PATCH] pinctrl: pinctrl-intel: move gpio suspend/resume to noirq phase

2019-04-08 Thread Mika Westerberg
restored. > > > > Normally, for a SMP system, there are multiple cores, so even when there are > > unintended interrupts, BSP gets the chance to init the gpio chip soon. > > gpio -> GPIO. > (If Mika is okay with patch content, I may fix this when applying) Yup, this looks good to me. Acked-by: Mika Westerberg

[PATCH v4 22/36] thunderbolt: Add support for full PCIe daisy chains

2019-04-10 Thread Mika Westerberg
Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb.c | 174 +++ drivers/thunderbolt/tb.h | 27 ++ 2 files changed, 129 insertions(+), 72 deletions(-) diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c index a62695a99835..cfc451c938fd 10

[PATCH v4 31/36] thunderbolt: Make tb_switch_alloc() return ERR_PTR()

2019-04-10 Thread Mika Westerberg
hardware when trying to access the possible switch. Convert all the current call sites to handle this properly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c| 6 +++--- drivers/thunderbolt/switch.c | 36 drivers/thunderbolt/tb.c | 6

[PATCH v4 29/36] thunderbolt: Add XDomain UUID exchange support

2019-04-10 Thread Mika Westerberg
that if the remote domain UUID is not filled in the core will query it first and only then start the normal property exchange flow. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb_msgs.h | 11 +++ drivers/thunderbolt/xdomain.c | 136 +++--- include/linux

[PATCH v4 10/36] thunderbolt: Configure lanes when switch is initialized

2019-04-10 Thread Mika Westerberg
Thunderbolt 2 devices and beyond need to have additional bits set in link controller specific registers. This includes two bits in LC_SX_CTRL that tell the link controller which lane is connected and whether it is upstream facing or not. Signed-off-by: Mika Westerberg --- drivers/thunderbolt

[PATCH v4 01/36] net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending

2019-04-10 Thread Mika Westerberg
unregistering the ThunderboltIP protocol handler when suspending and registering it back on resume. Signed-off-by: Mika Westerberg Acked-by: David S. Miller --- drivers/net/thunderbolt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/thunderbolt.c b/drivers/net/thunderbolt.c

[PATCH v4 06/36] thunderbolt: Do not allocate switch if depth is greater than 6

2019-04-10 Thread Mika Westerberg
Maximum depth in Thunderbolt topology is 6 so make sure it is not possible to allocate switches that exceed the depth limit. While at it update tb_switch_alloc() to use upper/lower_32_bits() following tb_switch_alloc_safe_mode(). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c

Re: [PATCH] PCIE/PME: fix possible use-after-free on remove

2019-02-25 Thread Mika Westerberg
Cc: Frederick Lawler > Cc: Mika Westerberg Reviewed-by: Mika Westerberg

Re: [PATCH] ACPI: property: Fix fwnode string properties matching

2021-02-12 Thread Mika Westerberg
uot;device property: Move FW type specific functionality to > FW specific files") > Reported-by: Calvin Johnson > Cc: 4.13+ # 4.13+ > Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg

Re: [PATCH v1] watchdog: wdat: add param. to start wdog on module insertion

2021-02-19 Thread Mika Westerberg
Hi, On Thu, Feb 18, 2021 at 05:32:00PM +0100, Flavio Suligoi wrote: > Add the parameter "start_enable" to start the watchdog > directly on module insertion. > > In an embedded system, for some applications, the watchdog > must be activated as soon as possible. > > In some embedded x86 boards the

Re: [v3] PCI: Avoid unsync of LTR mechanism configuration

2021-02-03 Thread Mika Westerberg
On Wed, Feb 03, 2021 at 10:14:01AM +0800, Mingchuang Qiao wrote: > Hi, > > On Mon, 2021-02-01 at 13:32 +0200, Mika Westerberg wrote: > > Hi, > > > > On Fri, Jan 29, 2021 at 03:11:37PM +0800, mingchuang.q...@mediatek.com > > wrote: > > > From: Mingchuan

Re: [v3] PCI: Avoid unsync of LTR mechanism configuration

2021-02-01 Thread Mika Westerberg
Hi, On Fri, Jan 29, 2021 at 03:11:37PM +0800, mingchuang.q...@mediatek.com wrote: > From: Mingchuang Qiao > > In bus scan flow, the "LTR Mechanism Enable" bit of DEVCTL2 register is > configured in pci_configure_ltr(). If device and bridge both support LTR > mechanism, the "LTR Mechanism Enable"

Re: [v4] PCI: Avoid unsync of LTR mechanism configuration

2021-02-04 Thread Mika Westerberg
s LTR for hot-remove/hot-add >-before restoring device's DEVCTL2 register when restore device state > > Signed-off-by: Mingchuang Qiao Reviewed-by: Mika Westerberg

Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable

2020-08-03 Thread Mika Westerberg
Hi, Sorry for the delay, I was on vacation. On Fri, Jul 24, 2020 at 06:28:53PM -0300, Daniel Gutson wrote: > Currently, intel-spi has a module argument that controls whether the driver > attempts to turn the SPI flash chip writeable. The default value > is FALSE (don't try to make it writeable).

Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable

2020-08-03 Thread Mika Westerberg
On Mon, Aug 03, 2020 at 11:18:12AM +0100, Richard Hughes wrote: > On Mon, 3 Aug 2020 at 10:57, Mika Westerberg > wrote: > > I think instead of this we should simply make it so that the driver > > never tries to make the chip writable. > > I think this is a good idea, but

Re: [PATCH] Module argument to control whether intel-spi-pci attempts to turn the SPI flash chip writeable

2020-08-03 Thread Mika Westerberg
On Mon, Aug 03, 2020 at 09:58:23AM -0300, Daniel Gutson wrote: > On Mon, Aug 3, 2020 at 7:27 AM Mika Westerberg > wrote: > > > > On Mon, Aug 03, 2020 at 11:18:12AM +0100, Richard Hughes wrote: > > > On Mon, 3 Aug 2020 at 10:57, Mika Westerberg > > > wrote

Re: linux-next: build failure after merge of the thunderbolt tree

2020-08-10 Thread Mika Westerberg
Hi all, On Mon, Aug 10, 2020 at 09:10:53AM +1000, Stephen Rothwell wrote: > Hi Linus, > > On Sun, 9 Aug 2020 11:04:28 -0700 Linus Torvalds > wrote: > > > > On Sun, Aug 9, 2020 at 1:19 AM Stephen Rothwell > > wrote: > > > > > > I looks like the above report got lost along the way to you :-(

Re: [PATCH] mtd: spi-nor: intel-spi: Do not try to make the SPI flash chip writable

2020-08-18 Thread Mika Westerberg
On Tue, Aug 18, 2020 at 12:55:59PM -0300, Daniel Gutson wrote: > > If you care about other (malicious) code writing to the driver, please > > explain > > what the specific attack scenario is that you are worried about, and > > why you think > > this is not sufficient. What code would be able to wr

Re: [PATCH] mtd: spi-nor: intel-spi: Do not try to make the SPI flash chip writable

2020-08-19 Thread Mika Westerberg
On Wed, Aug 19, 2020 at 10:38:24AM +0200, Arnd Bergmann wrote: > On Wed, Aug 19, 2020 at 8:57 AM Mika Westerberg > wrote: > > > > On Tue, Aug 18, 2020 at 12:55:59PM -0300, Daniel Gutson wrote: > > > > If you care about other (malicious) code writing to the d

Re: [PATCH] thunderbolt: Constify static attribute_group structs

2021-01-11 Thread Mika Westerberg
On Sat, Jan 09, 2021 at 12:09:19AM +0100, Rikard Falkeborn wrote: > The only usage of these is to put their addresses in arrays of pointers > to const attribute_groups. Make them const to allow the compiler to put > them in read-only memory. > > Signed-off-by: Rikard Falkeborn Applied to thunder

Re: linux-next: manual merge of the drm tree with the pci tree

2020-12-08 Thread Mika Westerberg
Hi, On Tue, Dec 08, 2020 at 01:27:54PM +1100, Stephen Rothwell wrote: > Hi all, > > Today's linux-next merge of the drm tree got a conflict in: > > drivers/gpu/vga/vga_switcheroo.c > > between commit: > > 99efde6c9bb7 ("PCI/PM: Rename pci_wakeup_bus() to pci_resume_bus()") > > from the pc

Re: Multiple MODALIAS= in uevent file confuses userspace

2021-01-18 Thread Mika Westerberg
Hi, On Mon, Jan 18, 2021 at 02:50:33PM +0100, Rafael J. Wysocki wrote: > CC Mika and Andy. > > On Mon, Jan 18, 2021 at 8:27 AM Kai-Heng Feng > wrote: > > > > On Sat, Jan 9, 2021 at 12:25 AM Kai-Heng Feng > > wrote: > > > > > > Commit 8765c5ba19490 ("ACPI / scan: Rework modalias creation when >

Re: Multiple MODALIAS= in uevent file confuses userspace

2021-01-18 Thread Mika Westerberg
On Mon, Jan 18, 2021 at 03:26:28PM +0100, Greg Kroah-Hartman wrote: > On Mon, Jan 18, 2021 at 04:12:38PM +0200, Mika Westerberg wrote: > > Hi, > > > > On Mon, Jan 18, 2021 at 02:50:33PM +0100, Rafael J. Wysocki wrote: > > > CC Mika and Andy. > > > > &g

Re: [PATCH] thunderbolt: Fix a double put in tb_cfg_read_raw

2021-03-23 Thread Mika Westerberg
Hi, On Mon, Mar 22, 2021 at 08:15:12PM -0700, Lv Yunlong wrote: > In tb_cfg_read_raw, req is allocated by tb_cfg_request_alloc() > with an initial reference. Before calling tb_cfg_request_sync(), > there is no refcount inc operation. tb_cfg_request_sync() > calls tb_cfg_request(..,req,..) and if t

Re: Re: [PATCH] thunderbolt: Fix a double put in tb_cfg_read_raw

2021-03-23 Thread Mika Westerberg
On Tue, Mar 23, 2021 at 10:30:16PM +0800, lyl2...@mail.ustc.edu.cn wrote: > > > > > -原始邮件- > > 发件人: "Mika Westerberg" > > 发送时间: 2021-03-23 22:06:47 (星期二) > > 收件人: "Lv Yunlong" > > 抄送: andreas.noe...@gmail.com,

Re: [PATCH v1 1/1] pinctrl: intel: No need to disable IRQs in the handler

2021-03-04 Thread Mika Westerberg
isabling IRQ part in the handler. > > Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg

Re: [PATCH 1/2] thunderbolt: Fix a leak in tb_retimer_add()

2021-03-30 Thread Mika Westerberg
On Mon, Mar 29, 2021 at 09:07:18AM +0300, Dan Carpenter wrote: > After the device_register() succeeds, then the correct way to clean up > is to call device_unregister(). The unregister calls both device_del() > and device_put(). Since this code was only device_del() it results in > a memory leak.

Re: [PATCH] resource: Prevent irqresource_disabled() from erasing flags

2021-03-30 Thread Mika Westerberg
Hi, On Tue, Mar 30, 2021 at 05:09:42PM +0200, Rafael J. Wysocki wrote: > On 3/29/2021 9:52 PM, Angela Czubak wrote: > > Do not overwrite flags as it leads to erasing triggering and polarity > > information which might be useful in case of hard-coded interrupts. > > This way the information can be

Re: [PATCH 1/2] thunderbolt: Fix a leak in tb_retimer_add()

2021-03-29 Thread Mika Westerberg
Hi, On Mon, Mar 29, 2021 at 10:02:20AM -0300, Jason Gunthorpe wrote: > On Mon, Mar 29, 2021 at 09:07:18AM +0300, Dan Carpenter wrote: > > After the device_register() succeeds, then the correct way to clean up > > is to call device_unregister(). The unregister calls both device_del() > > and devic

Re: [PATCH 1/2] thunderbolt: Fix a leak in tb_retimer_add()

2021-03-29 Thread Mika Westerberg
On Mon, Mar 29, 2021 at 11:54:05AM -0300, Jason Gunthorpe wrote: > On Mon, Mar 29, 2021 at 05:43:23PM +0300, Mika Westerberg wrote: > > > The nvm is a separate (physical Linux) device that gets added under this > > one. It cannot be added before AFAICT. > > Hum, yes, b

Re: [PATCH v1 3/7] PCI: New Primary to Sideband (P2SB) bridge support library

2021-04-01 Thread Mika Westerberg
On Thu, Apr 01, 2021 at 06:43:11PM +0300, Andy Shevchenko wrote: > On Sat, Mar 13, 2021 at 10:45:57AM +0100, Henning Schild wrote: > > Am Mon, 8 Mar 2021 14:20:16 +0200 > > schrieb Andy Shevchenko : > > ... > > > > + * pci_p2sb_bar - Get Primary to Sideband bridge (P2SB) device BAR > > > + * @pde

Re: [PATCH v1 3/7] PCI: New Primary to Sideband (P2SB) bridge support library

2021-04-01 Thread Mika Westerberg
On Thu, Apr 01, 2021 at 09:22:02PM +0300, Andy Shevchenko wrote: > On Thu, Apr 01, 2021 at 09:06:17PM +0300, Mika Westerberg wrote: > > On Thu, Apr 01, 2021 at 06:43:11PM +0300, Andy Shevchenko wrote: > > > On Sat, Mar 13, 2021 at 10:45:57AM +0100, Henning Schild wrote: > >

Re: [PATCH] PCI: PM: Do not read power state in pci_enable_device_flags()

2021-03-17 Thread Mika Westerberg
l...@gmail.com/ > Reported-by: Maximilian Luz > Tested-by: Maximilian Luz > Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg

Re: [PATCH net-next] net: thunderbolt: convert comma to semicolon

2020-12-09 Thread Mika Westerberg
On Wed, Dec 09, 2020 at 09:38:52PM +0800, Zheng Yongjun wrote: > Replace a comma between expression statements by a semicolon. > > Signed-off-by: Zheng Yongjun Acked-by: Mika Westerberg

[PATCH 01/12] thunderbolt: Move max_boot_acl field to correct place in struct icm

2020-11-19 Thread Mika Westerberg
This makes the kernel-doc to match the ordering and also this is better place for it, not between upstream_port and vnd_cap that are used together. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers

[PATCH 00/12] thunderbolt: USB4 NVM upgrade improvements & Maple Ridge support

2020-11-19 Thread Mika Westerberg
from Intel. This also includes a couple of minor cleanups and improvements around debug logging. Mika Westerberg (12): thunderbolt: Move max_boot_acl field to correct place in struct icm thunderbolt: Log which connection manager implementation is used thunderbolt: Log adapter numbers in

[PATCH 08/12] thunderbolt: Pass TX and RX data directly to usb4_switch_op()

2020-11-19 Thread Mika Westerberg
interface. Then make usb4_switch_op() and usb4_switch_op_data() call it with correct set of parameters and update the callers accordingly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/usb4.c | 85 +- 1 file changed, 48 insertions(+), 37 deletions

[PATCH 09/12] thunderbolt: Add connection manager specific hooks for USB4 router operations

2020-11-19 Thread Mika Westerberg
provided, get called instead of the native USB4 router operation. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb.h | 13 ++ drivers/thunderbolt/usb4.c | 50 +- 2 files changed, 57 insertions(+), 6 deletions(-) diff --git a/drivers/thunderbolt

[PATCH 06/12] thunderbolt: Perform USB4 router NVM upgrade in two phases

2020-11-19 Thread Mika Westerberg
userspace accordingly. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/switch.c | 20 -- drivers/thunderbolt/tb.h | 1 + drivers/thunderbolt/tb_regs.h | 1 + drivers/thunderbolt/usb4.c| 75 +++ 4 files changed, 77 insertions(+), 20 deletions

[PATCH 11/12] thunderbolt: Add USB4 router operation proxy for firmware connection manager

2020-11-19 Thread Mika Westerberg
icm_usb4_switch_nvm_authenticate_status() if available. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 214 -- drivers/thunderbolt/tb_msgs.h | 28 + 2 files changed, 232 insertions(+), 10 deletions(-) diff --git a/drivers/thunderbolt/icm.c b

[PATCH 03/12] thunderbolt: Log adapter numbers in decimal in path activation/deactivation

2020-11-19 Thread Mika Westerberg
This makes it consistent with other debug logs that already are using decimal number for adapters (ports). Signed-off-by: Mika Westerberg --- drivers/thunderbolt/path.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt

[PATCH 04/12] thunderbolt: Keep the parent runtime resumed for a while on device disconnect

2020-11-19 Thread Mika Westerberg
ff-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index beee6e6b8b6e..635b949fb1d6 100644 --- a/drivers/thunderbolt/icm.c +++ b/drivers/thunderbolt/icm.c @@ -870,7 +8

[PATCH 10/12] thunderbolt: Move constants for USB4 router operations to tb_regs.h

2020-11-19 Thread Mika Westerberg
We are going to use these in subsequent patch so make them available outside of usb4.c. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/tb_regs.h | 13 + drivers/thunderbolt/usb4.c| 12 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers

[PATCH 02/12] thunderbolt: Log which connection manager implementation is used

2020-11-19 Thread Mika Westerberg
This makes it easier to figure out whether the driver is using firmware or software based connection manager implementation. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 2 ++ drivers/thunderbolt/tb.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/thunderbolt

[PATCH 12/12] thunderbolt: Add support for Intel Maple Ridge

2020-11-19 Thread Mika Westerberg
Maple Ridge is first discrete USB4 host controller from Intel. It comes with firmware based connection manager and the flows are similar as used in Intel Titan Ridge. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/icm.c | 11 +++ drivers/thunderbolt/nhi.h | 1 + 2 files changed

[PATCH 07/12] thunderbolt: Pass metadata directly to usb4_switch_op()

2020-11-19 Thread Mika Westerberg
We are going to make usb4_switch_op() to match better the corresponding firmware (ICM) USB4 router operation proxy interface, so that we can use either based on the connection manager implementation. For this reason pass metadata directly to usb4_switch_op(). Signed-off-by: Mika Westerberg

[PATCH 05/12] thunderbolt: Return -ENOTCONN when ERR_CONN is received

2020-11-19 Thread Mika Westerberg
This allows the calling code to distinguish if the error was due to ERR_CONN (adapter is disconneced or disabled) or something else. Will be needed in USB4 router NVM update in the following patch. Signed-off-by: Mika Westerberg --- drivers/thunderbolt/ctl.c | 3 +++ 1 file changed, 3

Re: [PATCH v2] docs: ACPI: enumeration: add PCI hierarchy representation

2020-11-20 Thread Mika Westerberg
> and also to analyze the PCI bus topology of the board. > > This patch, with a practical example, show how to do this. > > Signed-off-by: Flavio Suligoi Reviewed-by: Mika Westerberg

Re: [PATCH 00/12] thunderbolt: USB4 NVM upgrade improvements & Maple Ridge support

2020-11-30 Thread Mika Westerberg
On Thu, Nov 19, 2020 at 06:55:11PM +0300, Mika Westerberg wrote: > Hi all, > > This series improves the USB4 router NVM upgrade functionality and adds > support for USB4 router operations proxy implemented by recent Intel > Thunderbolt firmware connection manager. The last patch a

Re: How to enable auto-suspend by default

2020-11-23 Thread Mika Westerberg
On Mon, Nov 23, 2020 at 02:54:19PM +0100, Hans de Goede wrote: > Hi, > > On 11/11/20 3:31 PM, Mika Westerberg wrote: > > On Wed, Nov 11, 2020 at 12:27:32PM +0100, Hans de Goede wrote: > >> Hi, > >> > >> On 11/10/20 6:25 PM, Mika Westerberg wrote: >

Re: [PATCH v1 1/2] PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()

2020-11-25 Thread Mika Westerberg
ss this scenario, use wakeup enable reference counting for > all devices, not just for bridges, so drop the last argument from > __acpi_device_wakeup_enable() and __acpi_pm_set_device_wakeup(), > which causes acpi_pm_set_device_wakeup() and > acpi_pm_set_bridge_wakeup() to become i

Re: [PATCH v1 2/2] PM: ACPI: Refresh wakeup device power configuration every time

2020-11-25 Thread Mika Westerberg
igned-off-by: Rafael J. Wysocki > Reported-by: Kai-Heng Feng > Tested-by: Kai-Heng Feng Reviewed-by: Mika Westerberg

Re: [RFT][PATCH v1 0/3] ACPI: scan: Defer enumeration of devices with significant dependencies

2020-12-17 Thread Mika Westerberg
supplied by the drivers of other > devices. > > This allows the OpRegion suppliers to be probed and start working before the > devices depending on them are enumerated. For the whole series, Reviewed-by: Mika Westerberg

Re: [PATCH] ACPI / device_sysfs: Use OF_MODALIAS for "compatible" modalias

2021-01-21 Thread Mika Westerberg
On Thu, Jan 21, 2021 at 02:22:43PM +0800, Kai-Heng Feng wrote: > On Tue, Jan 19, 2021 at 6:34 PM Greg Kroah-Hartman > wrote: > > > > On Tue, Jan 19, 2021 at 11:41:59AM +0200, Andy Shevchenko wrote: > > > On Tue, Jan 19, 2021 at 04:41:48PM +0800, Kai-Heng Feng wrote: > > > > On Tue, Jan 19, 2021 at

Re: [PATCH v1 1/3] gpiolib: acpi: Add ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER quirk

2021-03-02 Thread Mika Westerberg
On Tue, Mar 02, 2021 at 05:09:24PM +0200, Andy Shevchenko wrote: > On Tue, Mar 02, 2021 at 03:48:43PM +0100, Linus Walleij wrote: > > On Thu, Feb 25, 2021 at 5:33 PM Andy Shevchenko > > wrote: > > > > > On some systems the ACPI tables has wrong pin number and instead of > > > having a relative on

Re: [PATCH v1 1/1] pinctrl: intel: Show the GPIO base calculation explicitly

2021-03-08 Thread Mika Westerberg
ko I think this needs stable tag too. Acked-by: Mika Westerberg

Re: [PATCH v2] PCI: Re-enable downstream port LTR if it was previously enabled

2021-01-22 Thread Mika Westerberg
Jan 19, 2021 at 04:14:10PM +0300, Mika Westerberg wrote: > > > PCIe r5.0, sec 7.5.3.16 says that the downstream ports must reset the > > > LTR enable bit if the link goes down (port goes DL_Down status). Now, if > > > we had LTR previously enabled and the PCIe endpo

Re: [PATCH] ACPI / device_sysfs: Prefer "compatible" modalias

2021-01-22 Thread Mika Westerberg
alias are present, use the latter > one to ensure there's only one MODALIAS. > > Reference: https://github.com/systemd/systemd/pull/18163 > Cc: AceLan Kao > Cc: "Rafael J. Wysocki" > Cc: Greg Kroah-Hartman > Cc: Andy Shevchenko > Suggested-by: Mika Westerberg > Fi

Re: [RFC 3/3] thunderbolt: build kunit tests without structleak plugin

2021-01-27 Thread Mika Westerberg
Hi Arnd, On Mon, Jan 25, 2021 at 01:45:28PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The structleak plugin causes the stack frame size to grow immensely: > > drivers/thunderbolt/test.c:1529:1: error: the frame size of 1176 bytes is > larger than 1024 bytes [-Werror=frame-larger-th

Re: [PATCH 01/12] thunderbolt: dma_port: Remove unused variable 'ret'

2021-01-27 Thread Mika Westerberg
Hi, On Wed, Jan 27, 2021 at 04:19:16PM +, Lee Jones wrote: > On Wed, 27 Jan 2021, Andy Shevchenko wrote: > > > On Wednesday, January 27, 2021, Lee Jones wrote: > > > > > Fixes the following W=1 kernel build warning(s): > > > > > > drivers/thunderbolt/dma_port.c: In function ‘dma_port_flash

Re: [PATCH 05/12] thunderbolt: pa: Demote non-conformant kernel-doc headers

2021-01-27 Thread Mika Westerberg
On Wed, Jan 27, 2021 at 04:13:20PM +, Lee Jones wrote: > On Wed, 27 Jan 2021, Andy Shevchenko wrote: > > > On Wednesday, January 27, 2021, Lee Jones wrote: > > > > > Fixes the following W=1 kernel build warning(s): > > > > > > drivers/thunderbolt/path.c:476: warning: Function parameter or m

Re: [PATCH 05/12] thunderbolt: pa: Demote non-conformant kernel-doc headers

2021-01-28 Thread Mika Westerberg
On Thu, Jan 28, 2021 at 08:23:30AM +, Lee Jones wrote: > On Wed, 27 Jan 2021, Mika Westerberg wrote: > > > On Wed, Jan 27, 2021 at 04:13:20PM +, Lee Jones wrote: > > > On Wed, 27 Jan 2021, Andy Shevchenko wrote: > > > > > > > On Wed

Re: [PATCH V2 01/12] thunderbolt: dma_port: Check 'dma_port_flash_write_block()'s return value

2021-01-28 Thread Mika Westerberg
warning: variable ‘ret’ set but not > used [-Wunused-but-set-variable] > > Cc: Andreas Noever > Cc: Michael Jamet > Cc: Mika Westerberg > Cc: Yehezkel Bernat > Cc: linux-...@vger.kernel.org > Signed-off-by: Lee Jones Applied, thanks!

Re: [PATCH 00/12] Rid W=1 warnings from Thunderbolt

2021-01-28 Thread Mika Westerberg
Hi Lee, On Wed, Jan 27, 2021 at 11:25:42AM +, Lee Jones wrote: > This set is part of a larger effort attempting to clean-up W=1 > kernel builds, which are currently overwhelmingly riddled with > niggly little warnings. > > Only 1 small set required for Thunderbolt. Pretty good! > > Lee Jone

Re: [v2] PCI: Avoid unsync of LTR mechanism configuration

2021-01-28 Thread Mika Westerberg
Hi, On Thu, Jan 28, 2021 at 06:05:31PM +0800, mingchuang.q...@mediatek.com wrote: > From: Mingchuang Qiao > > In bus scan flow, the "LTR Mechanism Enable" bit of DEVCTL2 register is > configured in pci_configure_ltr(). If device and bridge both support LTR > mechanism, the "LTR Mechanism Enable"

[PATCH 0/6] gpio / ACPI: Rework ACPI GPIO events and add support for operation regions

2014-02-24 Thread Mika Westerberg
Patch [6/6]. These patches are based on two patches from Alexandre Courbot [2] which introduce gpiochip_get_desc() function. [1] http://www.spinics.net/lists/linux-acpi/msg46230.html [2] https://lkml.org/lkml/2014/2/9/24 Mika Westerberg (6): gpiolib: Allow GPIO chips to request their own GPIOs

[PATCH 2/6] gpio / ACPI: Allocate ACPI specific data directly in acpi_gpiochip_add()

2014-02-24 Thread Mika Westerberg
fields to struct acpi_gpio_chip. Signed-off-by: Mika Westerberg --- drivers/gpio/gpiolib-acpi.c | 83 - 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index b7db098ba060

[PATCH 6/6] gpio / ACPI: Add support for ACPI GPIO operation regions

2014-02-24 Thread Mika Westerberg
SL code we make sure that the GPIO stays requested until the GPIO chip driver itself is unloaded. If we find out that the GPIO is already requested we just toggle it according to the value got from ASL code. Signed-off-by: Mika Westerberg --- drivers/gpio/gpiolib-ac

[PATCH 3/6] gpio / ACPI: Rename acpi_gpio_evt_pin to acpi_gpio_event

2014-02-24 Thread Mika Westerberg
In order to consolidate _Exx, _Lxx and _EVT to use the same structure we make the structure name reflect that we are dealing with any event, not just _EVT. Signed-off-by: Mika Westerberg --- drivers/gpio/gpiolib-acpi.c | 56 ++--- 1 file changed, 28

[PATCH 4/6] gpio / ACPI: Embed events list directly into struct acpi_gpio_chip

2014-02-24 Thread Mika Westerberg
It is not necessary to have events as a pointer to list in struct acpi_gpio_chip. Instead we can embed the list_head directly to struct acpi_gpio_chip itself. This makes event handling a bit simpler because now we don't need to check whether the pointer is NULL or not. Signed-off-by:

[PATCH 5/6] gpio / ACPI: Rework ACPI GPIO event handling

2014-02-24 Thread Mika Westerberg
_desc() which takes GPIO spinlock we need to call acpi_gpiochip_remove() outside of that lock (analogous to acpi_gpiochip_add() path where the lock is released before those funtions are called). Signed-off-by: Mika Westerberg --- drivers/gpio/gpiolib-acpi.c

[PATCH 1/6] gpiolib: Allow GPIO chips to request their own GPIOs

2014-02-24 Thread Mika Westerberg
be sure that it cannot be unloaded without the driver knowing about that. Furthermore we only limit this functionality to be available only inside gpiolib. Signed-off-by: Mika Westerberg --- drivers/gpio/gpiolib.c | 57 +++--- drivers/gpio/gpiolib.h |

Re: [PATCH 1/6] gpiolib: Allow GPIO chips to request their own GPIOs

2014-02-26 Thread Mika Westerberg
On Tue, Feb 25, 2014 at 03:10:24PM +0100, Rafael J. Wysocki wrote: > On Monday, February 24, 2014 06:00:06 PM Mika Westerberg wrote: > > Sometimes it is useful to allow GPIO chips themselves to request GPIOs they > > own through gpiolib API. One usecase is ACPI ASL code that should

<    5   6   7   8   9   10   11   12   13   14   >