linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] coresight: etm4x: Migrate AMBA devices to platform driver
@ 2023-03-17  3:04 Anshuman Khandual
  2023-03-17  3:04 ` [PATCH 1/7] coresight: etm4x: Allocate and device assign 'struct etmv4_drvdata' earlier Anshuman Khandual
                   ` (7 more replies)
  0 siblings, 8 replies; 25+ messages in thread
From: Anshuman Khandual @ 2023-03-17  3:04 UTC (permalink / raw)
  To: linux-arm-kernel, coresight, suzuki.poulose
  Cc: scclevenger, Anshuman Khandual, Rob Herring, Frank Rowand,
	Russell King, Greg Kroah-Hartman, Rafael J. Wysocki, Len Brown,
	Sudeep Holla, Lorenzo Pieralisi, Mathieu Poirier, Mike Leach,
	Leo Yan, devicetree, linux-acpi, linux-kernel

CoreSight ETM4x devices could be accessed either via MMIO (handled via
amba_driver) or CPU system instructions (handled via platform driver). But
this has the following issues :

  - Each new CPU comes up with its own PID and thus we need to keep on
    adding the "known" PIDs to get it working with AMBA driver. While
    the ETM4 architecture (and CoreSight architecture) defines way to
    identify a device as ETM4. Thus older kernels  won't be able to
    "discover" a newer CPU, unless we add the PIDs.

  - With ACPI, the ETM4x devices have the same HID to identify the device
    irrespective of the mode of access. This creates a problem where two
    different drivers (both AMBA based driver and platform driver) would
    hook into the "HID" and could conflict. e.g., if AMBA driver gets
    hold of a non-MMIO device, the probe fails. If we have single driver
    hooked into the given "HID", we could handle them seamlessly,
    irrespective of the mode of access.

  - CoreSight is heavily dependent on the runtime power management. With
    ACPI, amba_driver doesn't get us anywhere with handling the power
    and thus one need to always turn the power ON to use them. Moving to
    platform driver gives us the power management for free.

Due to all of the above, we are moving the MMIO based etm4x devices to be
supported via platform driver. The series makes the existing platform
driver generic to handle both type of the access modes. With that we can
also remove the etm4x amba driver.

Finally, we need a way to make sure the new driver gets control of the
ETM4x device on a DT based system. CoreSight devices have always had the
"arm,primecell" in the compatible list. But the way this is handled
currently in OF code is a bit messy. The ETM4x devices are identified by
"arm,coresight-etm4x". The platform driver can never get a chance to probe
these devices, since the "arm,primecell" takes priority and is hard-coded
in the OF code. We have two options here :

1) Remove the arm,primecell from all DTS. This is fine for "new" kernels
with this change. But, for existing boards, using an older kernel will
break. Thus, is not preferred.

2) Add a white list of "compatibles" where the "priority" of the
"arm,primecell" can be ignored.

The series implements (2) above and applies on 6.3-rc2.

Cc: Steve Clevenger <scclevenger@os.amperecomputing.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Frank Rowand <frowand.list@gmail.com>
Cc: Russell King (Oracle) <linux@armlinux.org.uk>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lpieralisi@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: devicetree@vger.kernel.org
Cc: linux-acpi@vger.kernel.org
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org

Anshuman Khandual (6):
  coresight: etm4x: Allocate and device assign 'struct etmv4_drvdata' earlier
  coresight: etm4x: Drop iomem 'base' argument from etm4_probe()
  coresight: etm4x: Drop pid argument from etm4_probe()
  coresight: etm4x: Change etm4_platform_driver driver for MMIO devices
  of/platform: Skip coresight etm4x devices from AMBA bus
  coresight: etm4x: Drop the AMBA driver

Suzuki Poulose (1):
  coresight: etm4x: Add ACPI support in platform driver

 drivers/acpi/acpi_amba.c                      |   1 -
 .../coresight/coresight-etm4x-core.c          | 171 ++++++++----------
 drivers/hwtracing/coresight/coresight-etm4x.h |   3 +
 drivers/of/platform.c                         |  10 +-
 include/linux/coresight.h                     |  56 ++++++
 5 files changed, 143 insertions(+), 98 deletions(-)

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2023-03-21 16:04 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-17  3:04 [PATCH 0/7] coresight: etm4x: Migrate AMBA devices to platform driver Anshuman Khandual
2023-03-17  3:04 ` [PATCH 1/7] coresight: etm4x: Allocate and device assign 'struct etmv4_drvdata' earlier Anshuman Khandual
2023-03-17  3:04 ` [PATCH 2/7] coresight: etm4x: Drop iomem 'base' argument from etm4_probe() Anshuman Khandual
2023-03-17  3:04 ` [PATCH 3/7] coresight: etm4x: Drop pid " Anshuman Khandual
2023-03-18  8:21   ` kernel test robot
2023-03-20  2:54     ` Anshuman Khandual
2023-03-17  3:04 ` [PATCH 4/7] coresight: etm4x: Change etm4_platform_driver driver for MMIO devices Anshuman Khandual
2023-03-17  9:32   ` Suzuki K Poulose
2023-03-20  4:28     ` Anshuman Khandual
2023-03-18 10:24   ` kernel test robot
2023-03-20  3:05     ` Anshuman Khandual
2023-03-17  3:04 ` [PATCH 5/7] coresight: etm4x: Add ACPI support in platform driver Anshuman Khandual
2023-03-17  9:36   ` Suzuki K Poulose
2023-03-17  3:05 ` [PATCH 6/7] of/platform: Skip coresight etm4x devices from AMBA bus Anshuman Khandual
2023-03-17 14:52   ` Rob Herring
2023-03-17 16:03     ` Suzuki K Poulose
2023-03-17 20:06       ` Rob Herring
2023-03-20 10:37         ` Suzuki K Poulose
2023-03-20 14:05           ` Rob Herring
2023-03-20  5:37       ` Anshuman Khandual
2023-03-17  3:05 ` [PATCH 7/7] coresight: etm4x: Drop the AMBA driver Anshuman Khandual
2023-03-20 14:17 ` [PATCH 0/7] coresight: etm4x: Migrate AMBA devices to platform driver Rob Herring
2023-03-21 12:01   ` Suzuki K Poulose
2023-03-21 14:33   ` Sudeep Holla
2023-03-21 16:02     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).