* [Patch v5 0/7] Transition of fsl qspi driver to spi-mem framework
From: Kuldeep Singh @ 2020-02-20 17:27 UTC (permalink / raw)
To: u-boot
This entire patch series migrate freescale qspi driver to spi-mem
framework.
Patch 1 adds new qspi driver incorporating spi-mem framework and also
removal of old driver which was based on spi-nor. The driver is a ported
version of linux qspi driver. Initial port was done by Frieder. Now, no
more direct memory access to spi-nor memory is possible i.e accessing flash
memory using absolute address is not possible.
Patch 2 removes unused qspi config options for layerscape platforms.
Patch 3 removes unused qspi config options for imx platforms.
Patch 4 moves FSL_QSPI to defconfig instead of defining it in header files.
Patch 5 enables SPI_FLASH_SPANSION in ls1012a defconfig as FSL_QSPI is
already enabled.
Patch 6 enables SPI_FLASH_SPANSION in defconfigs of LS1046a boards instead
of defining in header files.
Patch 7 updates the device-tree properties treewide for layerscape boards
by aligning with linux device-tree properties.
v5:
-Remove compilation warning/error in patch1(qspi driver).
-Split patch 2 into 2 patches as changes will go via different tree.
-Remove imx dts change(previusly patch 4) as superseeded by Fabio's patch.
v4:
-Removal of buildman failure on LS2080AQDS
-Reword commit message of patch 5.
v3:
-Correction of copyright in qspi driver(Patch 1).
-Move SPI_FLASH_SPANSION from header to defconfig in same patch.
v2:
-Incorporate 1k size to make driver independent of flash size.
-Add support for imx platforms to set TDH bits correctly.
-Reword commit messages.
Patch[1] is required to resolve booting crash observed in LS1012ARDB. Crash
was related to pfe driver as it was accessing flash memory directly.
[1] https://patchwork.ozlabs.org/patch/1219462/
Kuldeep Singh (7):
spi: Transform the FSL QuadSPI driver to use the SPI MEM API
treewide: Remove unused FSL QSPI config options for Layerscape
platforms
treewide: Remove unused FSL QSPI config options for IMX platforms
configs: ls1043a: Move CONFIG_FSL_QSPI and SPI_FLASH_SPANSION to
defconfig
configs: ls1012a: Enable CONFIG_SPI_FLASH_SPANSION in defconfigs
configs: ls1046a: Move SPI_FLASH_SPANSION to defconfig
treewide: Update fsl qspi node dt properties as per spi-mem driver
arch/arm/dts/fsl-ls1012a-2g5rdb.dts | 5 +-
arch/arm/dts/fsl-ls1012a-frdm.dtsi | 5 +-
arch/arm/dts/fsl-ls1012a-qds.dtsi | 5 +-
arch/arm/dts/fsl-ls1012a-rdb.dtsi | 5 +-
arch/arm/dts/fsl-ls1012a.dtsi | 4 +-
arch/arm/dts/fsl-ls1043a-qds.dtsi | 5 +-
arch/arm/dts/fsl-ls1043a.dtsi | 6 +-
arch/arm/dts/fsl-ls1046a-frwy.dts | 5 +-
arch/arm/dts/fsl-ls1046a-qds.dtsi | 5 +-
arch/arm/dts/fsl-ls1046a-rdb.dts | 5 +-
arch/arm/dts/fsl-ls1046a.dtsi | 4 +-
arch/arm/dts/fsl-ls1088a-qds.dts | 5 +-
arch/arm/dts/fsl-ls1088a-rdb.dts | 5 +-
arch/arm/dts/fsl-ls1088a.dtsi | 2 +-
arch/arm/dts/fsl-ls2080a-qds.dts | 5 +-
arch/arm/dts/fsl-ls2080a.dtsi | 4 +-
arch/arm/dts/fsl-ls2088a-rdb-qspi.dts | 5 +-
arch/arm/dts/ls1021a-twr.dtsi | 5 +-
arch/arm/dts/ls1021a.dtsi | 6 +-
arch/arm/include/asm/arch-fsl-layerscape/config.h | 1 -
arch/arm/include/asm/arch-ls102xa/config.h | 1 -
configs/ls1012a2g5rdb_qspi_defconfig | 1 +
configs/ls1012a2g5rdb_tfa_defconfig | 1 +
configs/ls1012afrdm_qspi_defconfig | 1 +
configs/ls1012afrdm_tfa_defconfig | 1 +
configs/ls1012aqds_qspi_defconfig | 1 +
configs/ls1012aqds_tfa_SECURE_BOOT_defconfig | 1 +
configs/ls1012aqds_tfa_defconfig | 1 +
configs/ls1012ardb_qspi_SECURE_BOOT_defconfig | 1 +
configs/ls1012ardb_qspi_defconfig | 1 +
configs/ls1012ardb_tfa_SECURE_BOOT_defconfig | 1 +
configs/ls1012ardb_tfa_defconfig | 1 +
configs/ls1043aqds_qspi_defconfig | 1 +
configs/ls1043aqds_sdcard_qspi_defconfig | 1 +
configs/ls1043aqds_tfa_SECURE_BOOT_defconfig | 2 +
configs/ls1043aqds_tfa_defconfig | 1 +
configs/ls1046aqds_qspi_defconfig | 1 +
configs/ls1046aqds_sdcard_qspi_defconfig | 1 +
configs/ls1046aqds_tfa_SECURE_BOOT_defconfig | 1 +
configs/ls1046aqds_tfa_defconfig | 1 +
configs/ls1046ardb_qspi_SECURE_BOOT_defconfig | 1 +
configs/ls1046ardb_qspi_defconfig | 1 +
configs/ls1046ardb_tfa_SECURE_BOOT_defconfig | 1 +
configs/ls1046ardb_tfa_defconfig | 1 +
drivers/spi/fsl_qspi.c | 1577 ++++++++-------------
drivers/spi/fsl_qspi.h | 145 --
include/configs/ls1012a_common.h | 17 +-
include/configs/ls1012afrwy.h | 3 -
include/configs/ls1012ardb.h | 3 -
include/configs/ls1021aiot.h | 6 -
include/configs/ls1021aqds.h | 11 -
include/configs/ls1021atwr.h | 10 -
include/configs/ls1043aqds.h | 10 -
include/configs/ls1046afrwy.h | 9 -
include/configs/ls1046aqds.h | 19 -
include/configs/ls1046ardb.h | 20 -
include/configs/ls1088a_common.h | 6 -
include/configs/ls1088aqds.h | 8 -
include/configs/ls1088ardb.h | 18 -
include/configs/ls2080aqds.h | 5 -
include/configs/ls2080ardb.h | 6 +-
include/configs/mx6sxsabreauto.h | 6 -
include/configs/mx6sxsabresd.h | 11 -
include/configs/mx6ul_14x14_evk.h | 6 -
include/configs/mx6ullevk.h | 6 -
include/configs/mx7dsabresd.h | 8 -
include/configs/pcm052.h | 7 -
include/configs/vf610twr.h | 8 -
68 files changed, 669 insertions(+), 1373 deletions(-)
delete mode 100644 drivers/spi/fsl_qspi.h
--
2.7.4
^ permalink raw reply
* Re: [PATCH v5 1/4] xfs: Refactor xfs_isilocked()
From: Darrick J. Wong @ 2020-02-20 17:27 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Pavel Reichl, Eric Sandeen, linux-xfs
In-Reply-To: <20200220163232.GA1651@infradead.org>
On Thu, Feb 20, 2020 at 08:32:32AM -0800, Christoph Hellwig wrote:
> On Thu, Feb 20, 2020 at 05:30:35PM +0100, Pavel Reichl wrote:
> > OK, thanks for the comments.
> >
> > Eric in the following code is WARN_ONCE() used as you suggested or did
> > you have something else in mind?
> >
> > static inline bool
> > __xfs_rwsem_islocked(
> > struct rw_semaphore *rwsem,
> > bool excl)
> > {
> > if (!rwsem_is_locked(rwsem)) {
> > return false;
> > }
> >
> > if (excl) {
> > if (debug_locks) {
> > return lockdep_is_held_type(rwsem, 1);
> > }
> > WARN_ONCE(1,
> > "xfs rwsem lock testing coverage has been reduced\n");
> > }
>
> Yikes, hell no. This means every debug xfs build without lockdep
> will be full of warnings all the time.
Well... once per module load, but if you /were/ going to go down this
route I'd at least gate the warning on IS_ENABLED(CONFIG_LOCKDEP) so
that we only get this one-time warning when lockdep is enabled but dies
anyway, so that we'll know that we're running with half a brain.
--D
^ permalink raw reply
* Re: [RFC PATCH 02/11] ata: Remove Calxeda AHCI driver
From: Mark Langsdorf @ 2020-02-20 17:07 UTC (permalink / raw)
To: Rob Herring, linux-arm-kernel, linux-kernel, soc, Andre Przywara,
Robert Richter, Jon Loeliger, Alexander Graf, Matthias Brugger
Cc: kvm, Viresh Kumar, linux-ide, Will Deacon, linux-clk,
Daniel Lezcano, devicetree, linux-pm, Alex Williamson,
Borislav Petkov, Mauro Carvalho Chehab, linux-edac, Jens Axboe,
Tony Luck, Stephen Boyd, netdev, Cornelia Huck, Rafael J. Wysocki,
iommu, James Morse, Robin Murphy, David S. Miller
In-Reply-To: <20200218171321.30990-3-robh@kernel.org>
On 2/18/20 11:13 AM, Rob Herring wrote:
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: linux-ide@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
Acked-by: Mark Langsdorf <mark.langsdorf@gmail.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply
* Re: [RFC PATCH 04/11] cpufreq: Remove Calxeda driver
From: Mark Langsdorf @ 2020-02-20 17:06 UTC (permalink / raw)
To: Rob Herring, linux-arm-kernel, linux-kernel, soc, Andre Przywara,
Robert Richter, Jon Loeliger, Alexander Graf, Matthias Brugger
Cc: kvm, Viresh Kumar, linux-ide, Will Deacon, linux-clk,
Daniel Lezcano, devicetree, linux-pm, Alex Williamson,
Borislav Petkov, Mauro Carvalho Chehab, linux-edac, Jens Axboe,
Tony Luck, Stephen Boyd, netdev, Cornelia Huck, Rafael J. Wysocki,
iommu, James Morse, Robin Murphy, David S. Miller
In-Reply-To: <20200218171321.30990-5-robh@kernel.org>
On 2/18/20 11:13 AM, Rob Herring wrote:
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
Acked-by: Mark Langsdorf <mark.langsdorf@gmail.com>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply
* Re: [PATCH] ARM: dts: dra7-evm: Rename evm_3v3 regulator to vsys_3v3
From: Tony Lindgren @ 2020-02-20 17:27 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: devicetree, linux-kernel, robh+dt, bcousson, linux-omap,
linux-arm-kernel
In-Reply-To: <20200124121139.28657-1-peter.ujfalusi@ti.com>
* Peter Ujfalusi <peter.ujfalusi@ti.com> [200124 04:11]:
> On the new schematics it is renamed and the same name is used on other
> dra7 boards.
Applying into fixes thanks.
Tony
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] ARM: dts: dra7-evm: Rename evm_3v3 regulator to vsys_3v3
From: Tony Lindgren @ 2020-02-20 17:27 UTC (permalink / raw)
To: Peter Ujfalusi
Cc: bcousson, robh+dt, linux-omap, devicetree, linux-kernel,
linux-arm-kernel
In-Reply-To: <20200124121139.28657-1-peter.ujfalusi@ti.com>
* Peter Ujfalusi <peter.ujfalusi@ti.com> [200124 04:11]:
> On the new schematics it is renamed and the same name is used on other
> dra7 boards.
Applying into fixes thanks.
Tony
^ permalink raw reply
* Re: [PATCH v5 1/4] xfs: Refactor xfs_isilocked()
From: Eric Sandeen @ 2020-02-20 17:26 UTC (permalink / raw)
To: Christoph Hellwig, Pavel Reichl; +Cc: Darrick J. Wong, linux-xfs
In-Reply-To: <20200220163232.GA1651@infradead.org>
On 2/20/20 10:32 AM, Christoph Hellwig wrote:
> On Thu, Feb 20, 2020 at 05:30:35PM +0100, Pavel Reichl wrote:
>> OK, thanks for the comments.
>>
>> Eric in the following code is WARN_ONCE() used as you suggested or did
>> you have something else in mind?
>>
>> static inline bool
>> __xfs_rwsem_islocked(
>> struct rw_semaphore *rwsem,
>> bool excl)
>> {
>> if (!rwsem_is_locked(rwsem)) {
>> return false;
>> }
>>
>> if (excl) {
>> if (debug_locks) {
>> return lockdep_is_held_type(rwsem, 1);
>> }
>> WARN_ONCE(1,
>> "xfs rwsem lock testing coverage has been reduced\n");
>> }
>
> Yikes, hell no. This means every debug xfs build without lockdep
> will be full of warnings all the time.
Let's just drop my suggestion for now, no need to further complicate the series
at this time.
-Eric
^ permalink raw reply
* [RFC PATCH 6/7] i2c: of: mark a whole array of regs as reserved
From: Wolfram Sang @ 2020-02-20 17:24 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
Back then, 'reg' properties in I2C DT bindings only contained one
address and this address was assigned a device and, thus, blocked.
Meanwhile, chips using multiple addresses are common and the 'reg'
property can be an array described by 'reg-names'. This code enhances
I2C DT parsing, so it will reserve all addresses described in an array.
They will be bound to the 'dummy' driver as 'reserved' iff the first
address can be assigned successfully. If that is not the case, the array
is not further considered. If one later address of the array can not be
assigned, it will be reported but we don't bail out. The driver has to
decide if that address is critical or not.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-of.c | 68 +++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 24 deletions(-)
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 74b9f3fbb5ef..316db0c3b3c8 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -21,20 +21,12 @@
#include "i2c-core.h"
-int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
+static void of_i2c_decode_board_info(struct device_node *node, u32 addr,
+ bool first_addr, struct i2c_board_info *info)
{
- u32 addr;
- int ret;
-
memset(info, 0, sizeof(*info));
- ret = of_property_read_u32(node, "reg", &addr);
- if (ret) {
- pr_err("invalid reg on %pOF\n", node);
- return ret;
- }
-
- if (of_modalias_node(node, info->type, sizeof(info->type)) < 0)
+ if (!first_addr || of_modalias_node(node, info->type, sizeof(info->type)) < 0)
strlcpy(info->type, I2C_RESERVED_DRV_NAME, sizeof(I2C_RESERVED_DRV_NAME));
if (addr & I2C_TEN_BIT_ADDRESS) {
@@ -51,11 +43,27 @@ int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
info->of_node = node;
info->fwnode = of_fwnode_handle(node);
- if (of_property_read_bool(node, "host-notify"))
- info->flags |= I2C_CLIENT_HOST_NOTIFY;
+ if (first_addr) {
+ if (of_property_read_bool(node, "host-notify"))
+ info->flags |= I2C_CLIENT_HOST_NOTIFY;
+
+ if (of_get_property(node, "wakeup-source", NULL))
+ info->flags |= I2C_CLIENT_WAKE;
+ }
+}
+
+int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
+{
+ u32 addr;
+ int ret;
+
+ ret = of_property_read_u32(node, "reg", &addr);
+ if (ret) {
+ pr_err("invalid reg on %pOF\n", node);
+ return ret;
+ }
- if (of_get_property(node, "wakeup-source", NULL))
- info->flags |= I2C_CLIENT_WAKE;
+ of_i2c_decode_board_info(node, addr, true, info);
return 0;
}
@@ -64,21 +72,33 @@ EXPORT_SYMBOL_GPL(of_i2c_get_board_info);
static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
struct device_node *node)
{
- struct i2c_client *client;
+ struct i2c_client *client, *first_client = ERR_PTR(-ENOENT);
struct i2c_board_info info;
- int ret;
+ bool first_reg = true;
+ struct property *prop;
+ const __be32 *cur;
+ u32 reg;
pr_debug("register %pOF\n", node);
- ret = of_i2c_get_board_info(node, &info);
- if (ret)
- return ERR_PTR(ret);
+ of_property_for_each_u32(node, "reg", prop, cur, reg) {
+ of_i2c_decode_board_info(node, reg, first_reg, &info);
+
+ client = i2c_new_client_device(adap, &info);
+ if (IS_ERR(client)) {
+ pr_err("failure registering addr 0x%02x for %pOF\n",
+ reg, node);
+ if (first_reg)
+ return client;
+ }
- client = i2c_new_client_device(adap, &info);
- if (IS_ERR(client))
- pr_err("failure registering %pOF\n", node);
+ if (first_reg) {
+ first_client = client;
+ first_reg = false;
+ }
+ }
- return client;
+ return first_client;
}
void of_i2c_register_devices(struct i2c_adapter *adap)
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 7/7] i2c: core: hand over reserved devices when requesting ancillary addresses
From: Wolfram Sang @ 2020-02-20 17:24 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
With i2c_new_ancillary_address, we can check if the intended driver is
requesting a reserved address. Update the function to do these checks.
If the check passes, the "reserved" device will become a regular "dummy"
device.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-base.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 4000a4384306..ba325f8107a3 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -975,6 +975,8 @@ struct i2c_client *i2c_new_ancillary_device(struct i2c_client *client,
u16 default_addr)
{
struct device_node *np = client->dev.of_node;
+ struct device *reserved_dev, *adapter_dev = &client->adapter->dev;
+ struct i2c_client *reserved_client;
u32 addr = default_addr;
int i;
@@ -984,7 +986,21 @@ struct i2c_client *i2c_new_ancillary_device(struct i2c_client *client,
of_property_read_u32_index(np, "reg", i, &addr);
}
- dev_dbg(&client->adapter->dev, "Address for %s : 0x%x\n", name, addr);
+ dev_info(adapter_dev, "Address for %s : 0x%x\n", name, addr);
+
+ /* No need to scan muxes, siblings must sit on the same adapter */
+ reserved_dev = device_find_child(adapter_dev, &addr, __i2c_check_addr_busy);
+ reserved_client = i2c_verify_client(reserved_dev);
+
+ if (reserved_client) {
+ if (reserved_client->dev.of_node != np ||
+ strcmp(reserved_client->name, I2C_RESERVED_DRV_NAME) != 0)
+ return ERR_PTR(-EBUSY);
+
+ strlcpy(reserved_client->name, I2C_DUMMY_DRV_NAME, sizeof(client->name));
+ return reserved_client;
+ }
+
return i2c_new_dummy_device(client->adapter, addr);
}
EXPORT_SYMBOL_GPL(i2c_new_ancillary_device);
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 2/7] i2c: use DEFINE for the dummy driver name
From: Wolfram Sang @ 2020-02-20 17:23 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
We use it in multiple places, so make sure it is consistent whenever we
need to change it.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-base.c | 8 ++++----
drivers/i2c/i2c-core.h | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 8f46d1bb8c62..8df2fa10c48a 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -853,7 +853,7 @@ EXPORT_SYMBOL_GPL(i2c_unregister_device);
static const struct i2c_device_id dummy_id[] = {
- { "dummy", 0 },
+ { I2C_DUMMY_DRV_NAME, 0 },
{ },
};
@@ -869,7 +869,7 @@ static int dummy_remove(struct i2c_client *client)
}
static struct i2c_driver dummy_driver = {
- .driver.name = "dummy",
+ .driver.name = I2C_DUMMY_DRV_NAME,
.probe = dummy_probe,
.remove = dummy_remove,
.id_table = dummy_id,
@@ -896,7 +896,7 @@ static struct i2c_driver dummy_driver = {
struct i2c_client *i2c_new_dummy_device(struct i2c_adapter *adapter, u16 address)
{
struct i2c_board_info info = {
- I2C_BOARD_INFO("dummy", address),
+ I2C_BOARD_INFO(I2C_DUMMY_DRV_NAME, address),
};
return i2c_new_client_device(adapter, &info);
@@ -1487,7 +1487,7 @@ static void i2c_do_del_adapter(struct i2c_driver *driver,
static int __unregister_client(struct device *dev, void *dummy)
{
struct i2c_client *client = i2c_verify_client(dev);
- if (client && strcmp(client->name, "dummy"))
+ if (client && strcmp(client->name, I2C_DUMMY_DRV_NAME))
i2c_unregister_device(client);
return 0;
}
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index 517d98be68d2..fb89fabf84d3 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -22,6 +22,8 @@ int i2c_check_7bit_addr_validity_strict(unsigned short addr);
int i2c_dev_irq_from_resources(const struct resource *resources,
unsigned int num_resources);
+#define I2C_DUMMY_DRV_NAME "dummy"
+
/*
* We only allow atomic transfers for very late communication, e.g. to send
* the powerdown command to a PMIC. Atomic transfers are a corner case and not
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 5/7] i2c: of: error message unification
From: Wolfram Sang @ 2020-02-20 17:24 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
- don't prefix the device if %pOF is provided. That information is
enough.
- move the prefix to pr_fmt
- change prefix from "of_i2c" to "i2c_of" because the code was moved
out of the of-domain long ago
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-of.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 710704cd583e..74b9f3fbb5ef 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -8,6 +8,8 @@
* Copyright (C) 2013, 2018 Wolfram Sang <wsa@the-dreams.de>
*/
+#define pr_fmt(fmt) "i2c_of: " fmt
+
#include <dt-bindings/i2c/i2c.h>
#include <linux/device.h>
#include <linux/err.h>
@@ -28,7 +30,7 @@ int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
ret = of_property_read_u32(node, "reg", &addr);
if (ret) {
- pr_err("of_i2c: invalid reg on %pOF\n", node);
+ pr_err("invalid reg on %pOF\n", node);
return ret;
}
@@ -66,7 +68,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
struct i2c_board_info info;
int ret;
- dev_dbg(&adap->dev, "of_i2c: register %pOF\n", node);
+ pr_debug("register %pOF\n", node);
ret = of_i2c_get_board_info(node, &info);
if (ret)
@@ -74,7 +76,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
client = i2c_new_client_device(adap, &info);
if (IS_ERR(client))
- dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node);
+ pr_err("failure registering %pOF\n", node);
return client;
}
@@ -88,7 +90,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
if (!adap->dev.of_node)
return;
- dev_dbg(&adap->dev, "of_i2c: walking child nodes\n");
+ dev_dbg(&adap->dev, "walking child nodes\n");
bus = of_get_child_by_name(adap->dev.of_node, "i2c-bus");
if (!bus)
@@ -100,9 +102,7 @@ void of_i2c_register_devices(struct i2c_adapter *adap)
client = of_i2c_register_device(adap, node);
if (IS_ERR(client)) {
- dev_err(&adap->dev,
- "Failed to create I2C device for %pOF\n",
- node);
+ pr_err("failed to create I2C device for %pOF\n", node);
of_node_clear_flag(node, OF_POPULATED);
}
}
@@ -243,8 +243,7 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action,
client = of_i2c_register_device(adap, rd->dn);
if (IS_ERR(client)) {
- dev_err(&adap->dev, "failed to create client for '%pOF'\n",
- rd->dn);
+ pr_err("failed to create client for '%pOF'\n", rd->dn);
put_device(&adap->dev);
of_node_clear_flag(rd->dn, OF_POPULATED);
return notifier_from_errno(PTR_ERR(client));
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 3/7] i2c: allow DT nodes without 'compatible'
From: Wolfram Sang @ 2020-02-20 17:23 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
Sometimes, we have unknown devices in a system and still want to block
their address. For that, we allow DT nodes with only a 'reg' property.
These devices will be bound to the "dummy" driver but with the name
"reserved". That way, we can distinguish them and even hand them over to
the "dummy" driver later when they are really requested using
i2c_new_ancillary_device().
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Documentation/devicetree/bindings/i2c/i2c-ocores.txt | 1 -
Documentation/devicetree/bindings/i2c/i2c.txt | 4 +++-
drivers/i2c/i2c-core-base.c | 1 +
drivers/i2c/i2c-core-of.c | 8 +++-----
drivers/i2c/i2c-core.h | 1 +
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
index 6b25a80ae8d3..2762effdd270 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
@@ -50,7 +50,6 @@ Examples:
reg-io-width = <1>; /* 8 bit read/write */
dummy@60 {
- compatible = "dummy";
reg = <0x60>;
};
};
diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
index 9a53df4243c6..989b315e09dc 100644
--- a/Documentation/devicetree/bindings/i2c/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c.txt
@@ -21,7 +21,9 @@ flags can be attached to the address. I2C_TEN_BIT_ADDRESS is used to mark a 10
bit address. It is needed to avoid the ambiguity between e.g. a 7 bit address
of 0x50 and a 10 bit address of 0x050 which, in theory, can be on the same bus.
Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we listen to
-be devices ourselves.
+be devices ourselves. The 'reg' property of a child is required. The
+'compatible' property is not. Empty 'compatible' child entries can be used to
+describe unknown devices or addresses which shall be blocked for other reasons.
Optional properties
-------------------
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 8df2fa10c48a..4000a4384306 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -854,6 +854,7 @@ EXPORT_SYMBOL_GPL(i2c_unregister_device);
static const struct i2c_device_id dummy_id[] = {
{ I2C_DUMMY_DRV_NAME, 0 },
+ { I2C_RESERVED_DRV_NAME, 0 },
{ },
};
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 6787c1f71483..d8d111ad6c85 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -27,17 +27,15 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node,
memset(info, 0, sizeof(*info));
- if (of_modalias_node(node, info->type, sizeof(info->type)) < 0) {
- dev_err(dev, "of_i2c: modalias failure on %pOF\n", node);
- return -EINVAL;
- }
-
ret = of_property_read_u32(node, "reg", &addr);
if (ret) {
dev_err(dev, "of_i2c: invalid reg on %pOF\n", node);
return ret;
}
+ if (of_modalias_node(node, info->type, sizeof(info->type)) < 0)
+ strlcpy(info->type, I2C_RESERVED_DRV_NAME, sizeof(I2C_RESERVED_DRV_NAME));
+
if (addr & I2C_TEN_BIT_ADDRESS) {
addr &= ~I2C_TEN_BIT_ADDRESS;
info->flags |= I2C_CLIENT_TEN;
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index fb89fabf84d3..77b3a925ed95 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -23,6 +23,7 @@ int i2c_dev_irq_from_resources(const struct resource *resources,
unsigned int num_resources);
#define I2C_DUMMY_DRV_NAME "dummy"
+#define I2C_RESERVED_DRV_NAME "reserved"
/*
* We only allow atomic transfers for very late communication, e.g. to send
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 4/7] i2c: of: remove superfluous parameter from exported function
From: Wolfram Sang @ 2020-02-20 17:24 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
'dev' is only used for printing an error message. However, that
information is not needed because '%pOF' fully describes the location of
the error. Drop the 'dev' and remove the superfluous parameter.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-of.c | 7 +++----
drivers/i3c/master.c | 2 +-
include/linux/i2c.h | 6 ++----
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index d8d111ad6c85..710704cd583e 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -19,8 +19,7 @@
#include "i2c-core.h"
-int of_i2c_get_board_info(struct device *dev, struct device_node *node,
- struct i2c_board_info *info)
+int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
{
u32 addr;
int ret;
@@ -29,7 +28,7 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node,
ret = of_property_read_u32(node, "reg", &addr);
if (ret) {
- dev_err(dev, "of_i2c: invalid reg on %pOF\n", node);
+ pr_err("of_i2c: invalid reg on %pOF\n", node);
return ret;
}
@@ -69,7 +68,7 @@ static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
dev_dbg(&adap->dev, "of_i2c: register %pOF\n", node);
- ret = of_i2c_get_board_info(&adap->dev, node, &info);
+ ret = of_i2c_get_board_info(node, &info);
if (ret)
return ERR_PTR(ret);
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 7f8f896fa0c3..cc0549a9fc64 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1943,7 +1943,7 @@ of_i3c_master_add_i2c_boardinfo(struct i3c_master_controller *master,
if (!boardinfo)
return -ENOMEM;
- ret = of_i2c_get_board_info(dev, node, &boardinfo->base);
+ ret = of_i2c_get_board_info(node, &boardinfo->base);
if (ret)
return ret;
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index f834687989f7..d84aaf0d83d5 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -942,8 +942,7 @@ const struct of_device_id
*i2c_of_match_device(const struct of_device_id *matches,
struct i2c_client *client);
-int of_i2c_get_board_info(struct device *dev, struct device_node *node,
- struct i2c_board_info *info);
+int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info);
#else
@@ -969,8 +968,7 @@ static inline const struct of_device_id
return NULL;
}
-static inline int of_i2c_get_board_info(struct device *dev,
- struct device_node *node,
+static inline int of_i2c_get_board_info(struct device_node *node,
struct i2c_board_info *info)
{
return -ENOTSUPP;
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 0/7] i2c: of: reserve unknown and ancillary addresses
From: Wolfram Sang @ 2020-02-20 17:23 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
One outcome of my dynamic address assignment RFC series[1] was that we
need a way to describe an I2C bus in DT fully. This includes unknown
devices and devices requiring multiple addresses. This series implements
that.
Patches 1+2 do some preparational refactoring. After patch 3, we can
have child nodes with an address, but no compatible. Those addresses
will be marked busy now. They are handled by the dummy driver as well,
but named "reserved" instead of dummy. Patches 4+5 are again some
preparational refactoring. After patch 6, all addresses in a 'reg' array
are now blocked by the I2C core, also using the dummy driver but named
"reserved". So, we can have something like this:
dummy@13 {
reg = <0x13>, <0x14>;
};
After patch 7 then, i2c_new_ancillary_device is spiced up to look for
such a reserved address and return it as a good-old "dummy" device.
Sanity checks include that only a sibling from the same DT node can
request such an ancillary address. Stealing addresses from other drivers
is not possible anymore. This is something I envisioned for some time
now and I am quite happy with the implementation and how things work
There is only one thing giving me some headache now. There is a danger
of a regression maybe. If someone has multiple 'reg' entries in the DT
but never used i2c_new_ancillary_device but i2c_new_dummy_device, then
things will break now because i2c_new_dummy_device has not enough
information to convert a "reserved" device to a "dummy" one. It will
just see the address as busy. However, all binding documentations I
found which use 'reg' as an array correctly use
i2c_new_ancillary_device. On the other hand, my search strategy for
finding such bindings and DTs do not feel perfect to me. Maybe there are
also some more corner cases in this area, so this series is still RFC.
And some more documentation is needed. Before that, though, the generic
I2C binding docs need some overhaul, too.
All tested on a Renesas Lager board (R-Car H2). A git branch can be
found here:
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/topic/i2c_alias_device_v2
The I3C list is on CC not only because there is 1-line change in their
subsystem, but maybe also because they need to be aware of these changes
for their I2C fallback? I don't really know, let me know if you are not
interested.
Looking forward to comments!
Happy hacking,
Wolfram
[1] https://www.spinics.net/lists/linux-i2c/msg43291.html
Wolfram Sang (7):
i2c: add sanity check for parameter of i2c_verify_client()
i2c: use DEFINE for the dummy driver name
i2c: allow DT nodes without 'compatible'
i2c: of: remove superfluous parameter from exported function
i2c: of: error message unification
i2c: of: mark a whole array of regs as reserved
i2c: core: hand over reserved devices when requesting ancillary
addresses
.../devicetree/bindings/i2c/i2c-ocores.txt | 1 -
Documentation/devicetree/bindings/i2c/i2c.txt | 4 +-
drivers/i2c/i2c-core-base.c | 29 +++++--
drivers/i2c/i2c-core-of.c | 86 +++++++++++--------
drivers/i2c/i2c-core.h | 3 +
drivers/i3c/master.c | 2 +-
include/linux/i2c.h | 6 +-
7 files changed, 83 insertions(+), 48 deletions(-)
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply
* [RFC PATCH 1/7] i2c: add sanity check for parameter of i2c_verify_client()
From: Wolfram Sang @ 2020-02-20 17:23 UTC (permalink / raw)
To: linux-i2c
Cc: devicetree, Jacopo Mondi, Niklas Söderlund, Wolfram Sang,
linux-kernel, Vladimir Zapolskiy, linux-renesas-soc,
Kieran Bingham, Laurent Pinchart, Luca Ceresoli, linux-i3c
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
We export this function, so we should check the paramter to make it
NULL-compatible.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index cefad0881942..8f46d1bb8c62 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -517,7 +517,7 @@ EXPORT_SYMBOL_GPL(i2c_client_type);
*/
struct i2c_client *i2c_verify_client(struct device *dev)
{
- return (dev->type == &i2c_client_type)
+ return (dev && dev->type == &i2c_client_type)
? to_i2c_client(dev)
: NULL;
}
--
2.20.1
_______________________________________________
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
^ permalink raw reply related
* [RFC PATCH 3/7] i2c: allow DT nodes without 'compatible'
From: Wolfram Sang @ 2020-02-20 17:23 UTC (permalink / raw)
To: linux-i2c
Cc: linux-renesas-soc, linux-i3c, Kieran Bingham,
Niklas Söderlund, Luca Ceresoli, Jacopo Mondi,
Laurent Pinchart, Vladimir Zapolskiy, linux-kernel, devicetree,
Wolfram Sang
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
Sometimes, we have unknown devices in a system and still want to block
their address. For that, we allow DT nodes with only a 'reg' property.
These devices will be bound to the "dummy" driver but with the name
"reserved". That way, we can distinguish them and even hand them over to
the "dummy" driver later when they are really requested using
i2c_new_ancillary_device().
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Documentation/devicetree/bindings/i2c/i2c-ocores.txt | 1 -
Documentation/devicetree/bindings/i2c/i2c.txt | 4 +++-
drivers/i2c/i2c-core-base.c | 1 +
drivers/i2c/i2c-core-of.c | 8 +++-----
drivers/i2c/i2c-core.h | 1 +
5 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
index 6b25a80ae8d3..2762effdd270 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-ocores.txt
@@ -50,7 +50,6 @@ Examples:
reg-io-width = <1>; /* 8 bit read/write */
dummy@60 {
- compatible = "dummy";
reg = <0x60>;
};
};
diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
index 9a53df4243c6..989b315e09dc 100644
--- a/Documentation/devicetree/bindings/i2c/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c.txt
@@ -21,7 +21,9 @@ flags can be attached to the address. I2C_TEN_BIT_ADDRESS is used to mark a 10
bit address. It is needed to avoid the ambiguity between e.g. a 7 bit address
of 0x50 and a 10 bit address of 0x050 which, in theory, can be on the same bus.
Another flag is I2C_OWN_SLAVE_ADDRESS to mark addresses on which we listen to
-be devices ourselves.
+be devices ourselves. The 'reg' property of a child is required. The
+'compatible' property is not. Empty 'compatible' child entries can be used to
+describe unknown devices or addresses which shall be blocked for other reasons.
Optional properties
-------------------
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index 8df2fa10c48a..4000a4384306 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -854,6 +854,7 @@ EXPORT_SYMBOL_GPL(i2c_unregister_device);
static const struct i2c_device_id dummy_id[] = {
{ I2C_DUMMY_DRV_NAME, 0 },
+ { I2C_RESERVED_DRV_NAME, 0 },
{ },
};
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 6787c1f71483..d8d111ad6c85 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -27,17 +27,15 @@ int of_i2c_get_board_info(struct device *dev, struct device_node *node,
memset(info, 0, sizeof(*info));
- if (of_modalias_node(node, info->type, sizeof(info->type)) < 0) {
- dev_err(dev, "of_i2c: modalias failure on %pOF\n", node);
- return -EINVAL;
- }
-
ret = of_property_read_u32(node, "reg", &addr);
if (ret) {
dev_err(dev, "of_i2c: invalid reg on %pOF\n", node);
return ret;
}
+ if (of_modalias_node(node, info->type, sizeof(info->type)) < 0)
+ strlcpy(info->type, I2C_RESERVED_DRV_NAME, sizeof(I2C_RESERVED_DRV_NAME));
+
if (addr & I2C_TEN_BIT_ADDRESS) {
addr &= ~I2C_TEN_BIT_ADDRESS;
info->flags |= I2C_CLIENT_TEN;
diff --git a/drivers/i2c/i2c-core.h b/drivers/i2c/i2c-core.h
index fb89fabf84d3..77b3a925ed95 100644
--- a/drivers/i2c/i2c-core.h
+++ b/drivers/i2c/i2c-core.h
@@ -23,6 +23,7 @@ int i2c_dev_irq_from_resources(const struct resource *resources,
unsigned int num_resources);
#define I2C_DUMMY_DRV_NAME "dummy"
+#define I2C_RESERVED_DRV_NAME "reserved"
/*
* We only allow atomic transfers for very late communication, e.g. to send
--
2.20.1
^ permalink raw reply related
* Re: [PATCHv10 05/13] PCI: mobiveil: Add callback function for interrupt initialization
From: Andrew Murray @ 2020-02-20 17:25 UTC (permalink / raw)
To: Zhiqiang Hou
Cc: mark.rutland, devicetree, lorenzo.pieralisi, m.karthikeyan, arnd,
linux-pci, l.subrahmanya, will.deacon, linux-kernel, leoyang.li,
Minghuan.Lian, robh+dt, Mingkai.Hu, Xiaowei.Bao, catalin.marinas,
bhelgaas, andrew.murray, shawnguo, linux-arm-kernel
In-Reply-To: <20200213040644.45858-6-Zhiqiang.Hou@nxp.com>
On Thu, Feb 13, 2020 at 12:06:36PM +0800, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
>
> The Mobiveil GPEX internal MSI/INTx controller may not be used
> by other platforms in which the Mobiveil GPEX is integrated.
> This patch is to allow these platforms to implement their
> specific interrupt initialization.
>
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Andrew Murray <amurray@thegoodpenguin.co.uk>
> ---
> V10:
> - Introduced a helper function mobiveil_pcie_integrated_interrupt_init().
>
> drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 12 +++++++++++-
> drivers/pci/controller/mobiveil/pcie-mobiveil.h | 7 +++++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> index ea90d2f8692e..53ab8412a1de 100644
> --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> @@ -499,7 +499,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
> return 0;
> }
>
> -static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> +static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie)
> {
> struct platform_device *pdev = pcie->pdev;
> struct device *dev = &pdev->dev;
> @@ -539,6 +539,16 @@ static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> return 0;
> }
>
> +static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> +{
> + struct mobiveil_root_port *rp = &pcie->rp;
> +
> + if (rp->ops->interrupt_init)
> + return rp->ops->interrupt_init(pcie);
> +
> + return mobiveil_pcie_integrated_interrupt_init(pcie);
> +}
> +
> int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie)
> {
> struct mobiveil_root_port *rp = &pcie->rp;
> diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> index 81ffbbd48c08..0e6b5468c026 100644
> --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> @@ -130,10 +130,17 @@ struct mobiveil_msi { /* MSI information */
> DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI);
> };
>
> +struct mobiveil_pcie;
> +
> +struct mobiveil_rp_ops {
> + int (*interrupt_init)(struct mobiveil_pcie *pcie);
> +};
> +
> struct mobiveil_root_port {
> char root_bus_nr;
> void __iomem *config_axi_slave_base; /* endpoint config base */
> struct resource *ob_io_res;
> + struct mobiveil_rp_ops *ops;
> int irq;
> raw_spinlock_t intx_mask_lock;
> struct irq_domain *intx_domain;
> --
> 2.17.1
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: Kernel 5.5.4 build fail for BPF-selftests with latest LLVM
From: Alexei Starovoitov @ 2020-02-20 17:26 UTC (permalink / raw)
To: Bird, Tim
Cc: Jesper Dangaard Brouer, shuah, Daniel Díaz, Andrii Nakryiko,
Andrii Nakryiko, netdev@vger.kernel.org, BPF-dev-list,
Daniel Borkmann, David Miller, LKML, Greg Kroah-Hartman,
Anders Roxell, Toke Høiland-Jørgensen,
open list:KERNEL SELFTEST FRAMEWORK
In-Reply-To: <MWHPR13MB0895649219625C5F7380314FFD130@MWHPR13MB0895.namprd13.prod.outlook.com>
On Thu, Feb 20, 2020 at 05:02:25PM +0000, Bird, Tim wrote:
>
>
> > -----Original Message-----
> > From: Jesper Dangaard Brouer
> >
> > On Wed, 19 Feb 2020 17:47:23 -0700
> > shuah <shuah@kernel.org> wrote:
> >
> > > On 2/19/20 5:27 PM, Alexei Starovoitov wrote:
> > > > On Wed, Feb 19, 2020 at 03:59:41PM -0600, Daniel Díaz wrote:
> > > >>>
> > > >>> When I download a specific kernel release, how can I know what LLVM
> > > >>> git-hash or version I need (to use BPF-selftests)?
> > > >
> > > > as discussed we're going to add documentation-like file that will
> > > > list required commits in tools.
> > > > This will be enforced for future llvm/pahole commits.
> > > >
> > > >>> Do you think it is reasonable to require end-users to compile their own
> > > >>> bleeding edge version of LLVM, to use BPF-selftests?
> > > >
> > > > absolutely.
>
> Is it just the BPF-selftests that require the bleeding edge version of LLVM,
> or do BPF features themselves need the latest LLVM. If the latter, then this
> is quite worrisome, and I fear the BPF developers are getting ahead of themselves.
> We don't usually have a kernel dependency on the latest compiler version (some
> recent security fixes are an anomaly). In fact deprecating support for older compiler
> versions has been quite slow and methodical over the years.
>
> It's quite dangerous to be baking stuff into the kernel that depends on features
> from compilers that haven't even made it to release yet.
>
> I'm sorry, but I'm coming into the middle of this thread. Can you please explain
> what the features are in the latest LLVM that are required for BPF-selftests?
Above is correct. bpf kernel features do depend on the latest pahole and llvm
features that did not make it into a release. That was the case for many years
now and still the case. The first commit 8 years ago relied on something that
can generate those instructions. For many years llvm was the only compiler that
could generate them. Right now there is GCC backend as well. New features (like
new instructions) depend on the compiler.
selftests/bpf are not testing kernel's bpf features. They are testing the whole
bpf ecosystem. They test llvm, pahole, libbpf, bpftool, and kernel together.
Hence it's a requirement to install the latest pahole and llvm.
When I'm talking about selftests/bpf I'm talking about all the tests in that
directory combined. There are several unit tests scattered across repos. The
unit tests for llvm bpf backend are inside llvm repo.
selftests/bpf/test_verifier and test_maps are unit tests for the verifier and
for maps. They are llvm independent. They test a combination of kernel and
libbpf only. But majority of the selftests/bpf are done via test_progs which
are the whole ecosystem tests.
^ permalink raw reply
* Re: [Intel-gfx] [PATCH v3 3/3] drm/i915/display/fbc: Make fences a nice-to-have for GEN9+
From: Ville Syrjälä @ 2020-02-20 17:26 UTC (permalink / raw)
To: José Roberto de Souza; +Cc: Daniel Vetter, intel-gfx, Dhinakaran Pandiyan
In-Reply-To: <20200219014230.145601-3-jose.souza@intel.com>
On Tue, Feb 18, 2020 at 05:42:30PM -0800, José Roberto de Souza wrote:
> dGFX have local memory so it do not have aperture and do not support
> CPU fences but even for iGFX it have a small number of fences.
>
> As replacement for fences to track frontbuffer modifications by CPU
> we have a software tracking that is already in used by FBC and PSR.
> PSR don't support fences so it shows that this tracking is reliable.
>
> So lets make fences a nice-to-have to activate FBC for GEN9+, this
> will allow us to enable FBC for dGFXs and iGFXs even when there is no
> available fence.
>
> We do not set fences to rotated planes but FBC only have restrictions
> against 16bpp, so adding it here.
>
> Also adding a new check for the tiling format, fences are only set
> to X and Y tiled planes but again FBC don't have any restrictions
> against tiling so adding linear as supported as well, other formats
> should be added after tested but IGT only supports drawing in thse
> 3 formats.
>
> intel_fbc_hw_tracking_covers_screen() maybe can also have the same
> treatment as fences but BSpec is not clear if the size limitation is
> for hardware tracking or general use of FBC and I don't have a 5K
> display to test it, so keeping as is for safety.
>
> v2:
> - Added tiling and pixel format rotation checks
> - Changed the GEN version not requiring fences to 11 from 9, DDX
> needs some changes but it don't have support for GEN11+
>
> v3:
> - Changed back to GEN9+
> - Moved GEN test to inside of tiling_is_valid()
>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_fbc.c | 45 ++++++++++++++++++++----
> drivers/gpu/drm/i915/i915_drv.h | 1 +
> 2 files changed, 39 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index 1d76e3646a25..a0d1d661a006 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -585,7 +585,7 @@ static bool stride_is_valid(struct drm_i915_private *dev_priv,
> }
>
> static bool pixel_format_is_valid(struct drm_i915_private *dev_priv,
> - u32 pixel_format)
> + u32 pixel_format, unsigned int rotation)
> {
> switch (pixel_format) {
> case DRM_FORMAT_XRGB8888:
> @@ -599,6 +599,9 @@ static bool pixel_format_is_valid(struct drm_i915_private *dev_priv,
> /* WaFbcOnly1to1Ratio:ctg */
> if (IS_G4X(dev_priv))
> return false;
> + if ((rotation & (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270)) &&
> + INTEL_GEN(dev_priv) >= 9)
> + return false;
Would still would prefer a rotations_is_valid() or some such thing.
> return true;
> default:
> return false;
> @@ -639,6 +642,22 @@ static bool intel_fbc_hw_tracking_covers_screen(struct intel_crtc *crtc)
> return effective_w <= max_w && effective_h <= max_h;
> }
>
> +static bool tiling_is_valid(struct drm_i915_private *dev_priv,
> + uint64_t modifier)
> +{
> + switch (modifier) {
> + case DRM_FORMAT_MOD_LINEAR:
> + if (INTEL_GEN(dev_priv) >= 9)
> + return true;
Have we checked that eg. fbcon cursor still blinks correctly
with FBC active and all?
> + return false;
> + case I915_FORMAT_MOD_X_TILED:
> + case I915_FORMAT_MOD_Y_TILED:
> + return true;
> + default:
> + return false;
> + }
> +}
> +
> static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
> const struct intel_crtc_state *crtc_state,
> const struct intel_plane_state *plane_state)
> @@ -672,6 +691,7 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc,
>
> cache->fb.format = fb->format;
> cache->fb.stride = fb->pitches[0];
> + cache->fb.modifier = fb->modifier;
>
> drm_WARN_ON(&dev_priv->drm, plane_state->flags & PLANE_HAS_FENCE &&
> !plane_state->vma->fence);
> @@ -720,23 +740,33 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
> return false;
> }
>
> - /* The use of a CPU fence is mandatory in order to detect writes
> - * by the CPU to the scanout and trigger updates to the FBC.
> + /* The use of a CPU fence is one of two ways to detect writes by the
> + * CPU to the scanout and trigger updates to the FBC.
> + *
> + * The other method is by software tracking(see
> + * intel_fbc_invalidate/flush()), it will manually notify FBC and nuke
> + * the current compressed buffer and recompress it.
> *
> * Note that is possible for a tiled surface to be unmappable (and
> - * so have no fence associated with it) due to aperture constaints
> + * so have no fence associated with it) due to aperture constraints
> * at the time of pinning.
> *
> * FIXME with 90/270 degree rotation we should use the fence on
> * the normal GTT view (the rotated view doesn't even have a
> * fence). Would need changes to the FBC fence Y offset as well.
> - * For now this will effecively disable FBC with 90/270 degree
> + * For now this will effectively disable FBC with 90/270 degree
> * rotation.
> */
> - if (cache->fence_id < 0) {
> + if (INTEL_GEN(dev_priv) < 9 && cache->fence_id < 0) {
> fbc->no_fbc_reason = "framebuffer not tiled or fenced";
> return false;
> }
> +
> + if (!tiling_is_valid(dev_priv, cache->fb.modifier)) {
> + fbc->no_fbc_reason = "tiling unsupported";
> + return false;
> + }
> +
> if (INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv) &&
> cache->plane.rotation != DRM_MODE_ROTATE_0) {
> fbc->no_fbc_reason = "rotation unsupported";
> @@ -748,7 +778,8 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
> return false;
> }
>
> - if (!pixel_format_is_valid(dev_priv, cache->fb.format->format)) {
> + if (!pixel_format_is_valid(dev_priv, cache->fb.format->format,
> + cache->plane.rotation)) {
> fbc->no_fbc_reason = "pixel format is invalid";
> return false;
> }
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 3330b538d379..bf88663d8217 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -413,6 +413,7 @@ struct intel_fbc {
> struct {
> const struct drm_format_info *format;
> unsigned int stride;
> + u64 modifier;
> } fb;
> u16 gen9_wa_cfb_stride;
> s8 fence_id;
> --
> 2.25.1
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* Re: [PATCH 5/5] drm/sun4i: tcon: Support LVDS output on Allwinner A20
From: Maxime Ripard @ 2020-02-20 17:25 UTC (permalink / raw)
To: Andrey Lebedev
Cc: airlied, linux-sunxi, linux-kernel, dri-devel, Andrey Lebedev,
wens, daniel, linux-arm-kernel
In-Reply-To: <20200219180858.4806-6-andrey.lebedev@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 2544 bytes --]
On Wed, Feb 19, 2020 at 08:08:58PM +0200, Andrey Lebedev wrote:
> From: Andrey Lebedev <andrey@lebedev.lt>
>
> A20 SoC (found in Cubieboard 2 among others) requires different LVDS set
> up procedure than A33. Timing controller (tcon) driver only implements
> sun6i-style procedure, that doesn't work on A20 (sun7i).
>
> Signed-off-by: Andrey Lebedev <andrey@lebedev.lt>
> ---
> drivers/gpu/drm/sun4i/sun4i_tcon.c | 37 +++++++++++++++++++++++++++++-
> drivers/gpu/drm/sun4i/sun4i_tcon.h | 11 +++++++++
> 2 files changed, 47 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> index b7234eef3c7b..09ee6e8c6914 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c
> @@ -114,6 +114,30 @@ static void sun4i_tcon_channel_set_status(struct sun4i_tcon *tcon, int channel,
> }
> }
>
> +static void sun4i_tcon_setup_lvds_phy(struct sun4i_tcon *tcon,
> + const struct drm_encoder *encoder)
> +{
> + regmap_write(tcon->regs, SUN4I_TCON0_LVDS_ANA0_REG,
> + SUN4I_TCON0_LVDS_ANA0_CK_EN |
> + SUN4I_TCON0_LVDS_ANA0_REG_V |
> + SUN4I_TCON0_LVDS_ANA0_REG_C |
> + SUN4I_TCON0_LVDS_ANA0_EN_MB |
> + SUN4I_TCON0_LVDS_ANA0_PD |
> + SUN4I_TCON0_LVDS_ANA0_DCHS);
> +
> + udelay(2); /* delay at least 1200 ns */
> + regmap_update_bits(tcon->regs, SUN4I_TCON0_LVDS_ANA1_REG,
> + SUN4I_TCON0_LVDS_ANA1_INIT,
> + SUN4I_TCON0_LVDS_ANA1_INIT);
> + udelay(1); /* delay at least 120 ns */
> + regmap_update_bits(tcon->regs, SUN4I_TCON0_LVDS_ANA1_REG,
> + SUN4I_TCON0_LVDS_ANA1_UPDATE,
> + SUN4I_TCON0_LVDS_ANA1_UPDATE);
> + regmap_update_bits(tcon->regs, SUN4I_TCON0_LVDS_ANA0_REG,
> + SUN4I_TCON0_LVDS_ANA0_EN_MB,
> + SUN4I_TCON0_LVDS_ANA0_EN_MB);
> +}
> +
> static void sun6i_tcon_setup_lvds_phy(struct sun4i_tcon *tcon,
> const struct drm_encoder *encoder)
> {
> @@ -1455,7 +1479,18 @@ static const struct sun4i_tcon_quirks sun6i_a31s_quirks = {
> .dclk_min_div = 1,
> };
>
> +static const struct sun4i_tcon_quirks sun7i_a20_tcon0_quirks = {
> + .supports_lvds = true,
> + .has_channel_0 = true,
> + .has_channel_1 = true,
> + .dclk_min_div = 4,
> + /* Same display pipeline structure as A10 */
> + .set_mux = sun4i_a10_tcon_set_mux,
> + .setup_lvds_phy = sun4i_tcon_setup_lvds_phy,
> +};
> +
> static const struct sun4i_tcon_quirks sun7i_a20_quirks = {
> + .supports_lvds = false,
False is already the default here.
I've removed it while applying
Maxime
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* [RFC PATCH 6/7] i2c: of: mark a whole array of regs as reserved
From: Wolfram Sang @ 2020-02-20 17:24 UTC (permalink / raw)
To: linux-i2c
Cc: linux-renesas-soc, linux-i3c, Kieran Bingham,
Niklas Söderlund, Luca Ceresoli, Jacopo Mondi,
Laurent Pinchart, Vladimir Zapolskiy, linux-kernel, devicetree,
Wolfram Sang
In-Reply-To: <20200220172403.26062-1-wsa+renesas@sang-engineering.com>
Back then, 'reg' properties in I2C DT bindings only contained one
address and this address was assigned a device and, thus, blocked.
Meanwhile, chips using multiple addresses are common and the 'reg'
property can be an array described by 'reg-names'. This code enhances
I2C DT parsing, so it will reserve all addresses described in an array.
They will be bound to the 'dummy' driver as 'reserved' iff the first
address can be assigned successfully. If that is not the case, the array
is not further considered. If one later address of the array can not be
assigned, it will be reported but we don't bail out. The driver has to
decide if that address is critical or not.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/i2c-core-of.c | 68 +++++++++++++++++++++++++--------------
1 file changed, 44 insertions(+), 24 deletions(-)
diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 74b9f3fbb5ef..316db0c3b3c8 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c
@@ -21,20 +21,12 @@
#include "i2c-core.h"
-int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
+static void of_i2c_decode_board_info(struct device_node *node, u32 addr,
+ bool first_addr, struct i2c_board_info *info)
{
- u32 addr;
- int ret;
-
memset(info, 0, sizeof(*info));
- ret = of_property_read_u32(node, "reg", &addr);
- if (ret) {
- pr_err("invalid reg on %pOF\n", node);
- return ret;
- }
-
- if (of_modalias_node(node, info->type, sizeof(info->type)) < 0)
+ if (!first_addr || of_modalias_node(node, info->type, sizeof(info->type)) < 0)
strlcpy(info->type, I2C_RESERVED_DRV_NAME, sizeof(I2C_RESERVED_DRV_NAME));
if (addr & I2C_TEN_BIT_ADDRESS) {
@@ -51,11 +43,27 @@ int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
info->of_node = node;
info->fwnode = of_fwnode_handle(node);
- if (of_property_read_bool(node, "host-notify"))
- info->flags |= I2C_CLIENT_HOST_NOTIFY;
+ if (first_addr) {
+ if (of_property_read_bool(node, "host-notify"))
+ info->flags |= I2C_CLIENT_HOST_NOTIFY;
+
+ if (of_get_property(node, "wakeup-source", NULL))
+ info->flags |= I2C_CLIENT_WAKE;
+ }
+}
+
+int of_i2c_get_board_info(struct device_node *node, struct i2c_board_info *info)
+{
+ u32 addr;
+ int ret;
+
+ ret = of_property_read_u32(node, "reg", &addr);
+ if (ret) {
+ pr_err("invalid reg on %pOF\n", node);
+ return ret;
+ }
- if (of_get_property(node, "wakeup-source", NULL))
- info->flags |= I2C_CLIENT_WAKE;
+ of_i2c_decode_board_info(node, addr, true, info);
return 0;
}
@@ -64,21 +72,33 @@ EXPORT_SYMBOL_GPL(of_i2c_get_board_info);
static struct i2c_client *of_i2c_register_device(struct i2c_adapter *adap,
struct device_node *node)
{
- struct i2c_client *client;
+ struct i2c_client *client, *first_client = ERR_PTR(-ENOENT);
struct i2c_board_info info;
- int ret;
+ bool first_reg = true;
+ struct property *prop;
+ const __be32 *cur;
+ u32 reg;
pr_debug("register %pOF\n", node);
- ret = of_i2c_get_board_info(node, &info);
- if (ret)
- return ERR_PTR(ret);
+ of_property_for_each_u32(node, "reg", prop, cur, reg) {
+ of_i2c_decode_board_info(node, reg, first_reg, &info);
+
+ client = i2c_new_client_device(adap, &info);
+ if (IS_ERR(client)) {
+ pr_err("failure registering addr 0x%02x for %pOF\n",
+ reg, node);
+ if (first_reg)
+ return client;
+ }
- client = i2c_new_client_device(adap, &info);
- if (IS_ERR(client))
- pr_err("failure registering %pOF\n", node);
+ if (first_reg) {
+ first_client = client;
+ first_reg = false;
+ }
+ }
- return client;
+ return first_client;
}
void of_i2c_register_devices(struct i2c_adapter *adap)
--
2.20.1
^ permalink raw reply related
* [dpdk-dev] [Bug 402] i40e: cannot add rte_flow with ether_type = ARP
From: bugzilla @ 2020-02-20 17:25 UTC (permalink / raw)
To: dev
https://bugs.dpdk.org/show_bug.cgi?id=402
Bug ID: 402
Summary: i40e: cannot add rte_flow with ether_type = ARP
Product: DPDK
Version: unspecified
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: dev@dpdk.org
Reporter: maxime.leroy@6wind.com
Target Milestone: ---
Looking into the DPDK Test Plans for i40e, we can see that adding a rte_flow
rule with ether_type equals to ARP should work:
See: https://doc.dpdk.org/dts/test_plans/generic_flow_api_test_plan.html (27.2.
Test case: Fortville ethertype).
When we test with the dpdk master (commit id 538da7a1c), it's a different
story.
::
./build/app/testpmd --legacy-mem -c 1f -n 4 -w 0000:85:00.1 -- -i
--rxq=1 --txq=1 --total-num-mbufs=10000
....
EAL: PCI device 0000:85:00.1 on NUMA socket 1
EAL: probe driver: 8086:1583 net_i40e
EAL: using IOMMU type 1 (Type 1)
...
testpmd> flow validate 0 ingress pattern eth type is 0x0806 / end actions mark
id 0x86 / rss / end
port_flow_complain(): Caught PMD error type 13 (specific pattern item):
cause: 0x200130880, Unsupported ether_type.: Invalid argument
The pmd complain that the ARP ether_type is not supported. This issue is
related to this test in the code:
https://git.dpdk.org/dpdk/tree/drivers/net/i40e/i40e_flow.c?id=b565280d45022292e566cf98f8ccf926d8048d2c#n2649
Let's try to patch this conditional test:
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2649,7 +2649,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
if (next_type == RTE_FLOW_ITEM_TYPE_VLAN ||
ether_type == RTE_ETHER_TYPE_IPV4 ||
ether_type == RTE_ETHER_TYPE_IPV6 ||
- ether_type == RTE_ETHER_TYPE_ARP ||
+ //ether_type == RTE_ETHER_TYPE_ARP ||
ether_type == outer_tpid) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_I
Test again with testpmd:
./build/app/testpmd --legacy-mem -c 1f -n 4 -w 0000:85:00.1 -- -i --rxq=1
--txq=1 --total-num-mbufs=10000
testpmd> flow validate 0 ingress pattern eth type is 0x0806 / end actions mark
id 0x86 / rss / end
Flow rule validated
testpmd> flow create 0 ingress pattern eth type is 0x0806 / end actions mark id
0x86 / rss / end
Flow rule #0 created
Now it's working fine. Let's send an arp packet on this interface to see if
it's really working on the hardware side:
testpmd> set fwd rxonly
Set rxonly packet forwarding mode
testpmd> set verbose 1
Change verbose level from 0 to 1
testpmd> start
...
testpmd> port 0/queue 0: received 1 packets
src=3C:FD:FE:A2:7D:E0 - dst=3C:FD:FE:A2:80:F8 - type=0x0806 - length=60 -
nb_segs=1 - FDIR matched ID=0x86 - hw ptype: L2_ETHER_ARP - sw ptype: L2_ETHER
- l2_len=14 - Receive queue=0x0
ol_flags: PKT_RX_FDIR PKT_RX_L4_CKSUM_GOOD PKT_RX_IP_CKSUM_GOOD
PKT_RX_FDIR_ID PKT_RX_OUTER_L4_CKSUM_UNKNOWN
ARP is correctly matched by the i40e nic. I am not sure to understand why
i40e_flow_parse_fdir_pattern don't want to create rule matching ethertype = arp
(ipv4, ipv6).
The following commit introduces this conditional test: 42044b69c67d ("net/i40e:
support input set selection for FDIR").
--
You are receiving this mail because:
You are the assignee for the bug.
^ permalink raw reply
* Re: [PATCH 4/5] dt-bindings: display: sun4i: New compatibles for A20 tcons
From: Maxime Ripard @ 2020-02-20 17:24 UTC (permalink / raw)
To: Andrey Lebedev
Cc: airlied, linux-sunxi, linux-kernel, dri-devel, Andrey Lebedev,
wens, daniel, linux-arm-kernel
In-Reply-To: <20200219180858.4806-5-andrey.lebedev@gmail.com>
[-- Attachment #1.1: Type: text/plain, Size: 1130 bytes --]
On Wed, Feb 19, 2020 at 08:08:57PM +0200, Andrey Lebedev wrote:
> From: Andrey Lebedev <andrey@lebedev.lt>
>
> Document new compatibles used to differentiate between timing
> controllers on A20 (sun7i)
>
> Signed-off-by: Andrey Lebedev <andrey@lebedev.lt>
> ---
> .../bindings/display/allwinner,sun4i-a10-tcon.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml b/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> index 86ad617d2327..c0f6bb16fa34 100644
> --- a/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> +++ b/Documentation/devicetree/bindings/display/allwinner,sun4i-a10-tcon.yaml
> @@ -46,6 +46,12 @@ properties:
> - allwinner,sun50i-h6-tcon-tv
> - const: allwinner,sun8i-a83t-tcon-tv
>
> + - items:
> + - enum:
> + - allwinner,sun7i-a20-tcon0
> + - allwinner,sun7i-a20-tcon1
> + - const: allwinner,sun7i-a20-tcon
> +
> reg:
> maxItems: 1
It wasn't ordered propertly, I've fixed it up while applying
Maxime
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCHv10 05/13] PCI: mobiveil: Add callback function for interrupt initialization
From: Andrew Murray @ 2020-02-20 17:25 UTC (permalink / raw)
To: Zhiqiang Hou
Cc: linux-pci, linux-arm-kernel, devicetree, linux-kernel, bhelgaas,
robh+dt, andrew.murray, arnd, mark.rutland, l.subrahmanya,
shawnguo, m.karthikeyan, leoyang.li, lorenzo.pieralisi,
catalin.marinas, will.deacon, Mingkai.Hu, Minghuan.Lian,
Xiaowei.Bao
In-Reply-To: <20200213040644.45858-6-Zhiqiang.Hou@nxp.com>
On Thu, Feb 13, 2020 at 12:06:36PM +0800, Zhiqiang Hou wrote:
> From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
>
> The Mobiveil GPEX internal MSI/INTx controller may not be used
> by other platforms in which the Mobiveil GPEX is integrated.
> This patch is to allow these platforms to implement their
> specific interrupt initialization.
>
> Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: Andrew Murray <amurray@thegoodpenguin.co.uk>
> ---
> V10:
> - Introduced a helper function mobiveil_pcie_integrated_interrupt_init().
>
> drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 12 +++++++++++-
> drivers/pci/controller/mobiveil/pcie-mobiveil.h | 7 +++++++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> index ea90d2f8692e..53ab8412a1de 100644
> --- a/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
> @@ -499,7 +499,7 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
> return 0;
> }
>
> -static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> +static int mobiveil_pcie_integrated_interrupt_init(struct mobiveil_pcie *pcie)
> {
> struct platform_device *pdev = pcie->pdev;
> struct device *dev = &pdev->dev;
> @@ -539,6 +539,16 @@ static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> return 0;
> }
>
> +static int mobiveil_pcie_interrupt_init(struct mobiveil_pcie *pcie)
> +{
> + struct mobiveil_root_port *rp = &pcie->rp;
> +
> + if (rp->ops->interrupt_init)
> + return rp->ops->interrupt_init(pcie);
> +
> + return mobiveil_pcie_integrated_interrupt_init(pcie);
> +}
> +
> int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie)
> {
> struct mobiveil_root_port *rp = &pcie->rp;
> diff --git a/drivers/pci/controller/mobiveil/pcie-mobiveil.h b/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> index 81ffbbd48c08..0e6b5468c026 100644
> --- a/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> +++ b/drivers/pci/controller/mobiveil/pcie-mobiveil.h
> @@ -130,10 +130,17 @@ struct mobiveil_msi { /* MSI information */
> DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI);
> };
>
> +struct mobiveil_pcie;
> +
> +struct mobiveil_rp_ops {
> + int (*interrupt_init)(struct mobiveil_pcie *pcie);
> +};
> +
> struct mobiveil_root_port {
> char root_bus_nr;
> void __iomem *config_axi_slave_base; /* endpoint config base */
> struct resource *ob_io_res;
> + struct mobiveil_rp_ops *ops;
> int irq;
> raw_spinlock_t intx_mask_lock;
> struct irq_domain *intx_domain;
> --
> 2.17.1
>
^ permalink raw reply
* Re: [PATCH 2/2] ufshcd: use an enum for quirks
From: Christoph Hellwig @ 2020-02-20 17:25 UTC (permalink / raw)
To: Bart Van Assche; +Cc: Christoph Hellwig, linux-scsi, Alim Akhtar, Avri Altman
In-Reply-To: <b4c75415-347a-48e6-ddc7-d419d7774f22@acm.org>
On Tue, Feb 18, 2020 at 04:10:57PM -0800, Bart Van Assche wrote:
> On 2/18/20 3:44 PM, Christoph Hellwig wrote:
>> Use an enum to specify the various quirks instead of #defines inside
>> the structure definition.
>
> Hi Christoph,
>
> Although this patch looks like a significant improvement to me: has it been
> considered to change 'quirks' from an unsigned int into a bitfield with one
> bit per quirk? I think that would allow to remove multiple explicit bit
> manipulations from the UFS driver.
And it wouldn't make it quite as obvious what are quirks. Never mind that
the compiler would still do the masking and potentially affect other fields
placed right next to it. Bitfields tend to be a bad idea just about
everywhere.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.