linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Support managed interrupts for platform devices
@ 2020-10-27 12:10 John Garry
  2020-10-27 12:10 ` [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc() John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: John Garry @ 2020-10-27 12:10 UTC (permalink / raw)
  To: gregkh, rafael, martin.petersen, jejb, tglx
  Cc: linuxarm, linux-scsi, linux-kernel, maz, John Garry

So far, managed interrupts are only used for PCI MSIs. This series add
platform device support for managed interrupts. Initially this topic was
discussed at [0].

The method to enable managed interrupts is to allocate all the IRQs for
the device, and then switch the interrupts to managed - this is done
through new function irq_update_affinity_desc().

API platform_get_irqs_affinity() is added as a helper to manage this work,
such that we don't need to export irq_update_affinity_desc() or
irq_create_affinity_masks().

For now, the HiSilicon SAS v2 hw driver is switched over. This is used
in the D05 dev board.

Performance gain observed for 6x SAS SSDs is ~357K -> 420K IOPs for fio read.

I hope - all going well - this series can go through the SCSI tree, since
the non-SCSI changes are additive, thanks!

[0] https://lore.kernel.org/lkml/84a9411b-4ae3-1928-3d35-1666f2687ec8@huawei.com/

John Garry (2):
  Driver core: platform: Add platform_get_irqs_affinity()
  scsi: hisi_sas: Expose HW queues for v2 hw

Thomas Gleixner (1):
  genirq/affinity: Add irq_update_affinity_desc()

 drivers/base/platform.c                | 58 +++++++++++++++++++++
 drivers/scsi/hisi_sas/hisi_sas.h       |  4 ++
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 11 ++++
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 71 ++++++++++++++++++++++----
 include/linux/interrupt.h              |  8 +++
 include/linux/platform_device.h        |  5 ++
 kernel/irq/manage.c                    | 19 +++++++
 7 files changed, 165 insertions(+), 11 deletions(-)

-- 
2.26.2


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

* [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc()
  2020-10-27 12:10 [PATCH 0/3] Support managed interrupts for platform devices John Garry
@ 2020-10-27 12:10 ` John Garry
  2020-10-27 15:22   ` Thomas Gleixner
  2020-10-27 12:10 ` [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity() John Garry
  2020-10-27 12:10 ` [PATCH 3/3] scsi: hisi_sas: Expose HW queues for v2 hw John Garry
  2 siblings, 1 reply; 7+ messages in thread
From: John Garry @ 2020-10-27 12:10 UTC (permalink / raw)
  To: gregkh, rafael, martin.petersen, jejb, tglx
  Cc: linuxarm, linux-scsi, linux-kernel, maz, John Garry

From: Thomas Gleixner <tglx@linutronix.de>

Add a function to allow the affinity of an interrupt be switched to
managed, such that interrupts allocated for platform devices may be
managed.

<Insert author sob>
[jpg: Add commit message and add prototypes]
Signed-off-by: John Garry <john.garry@huawei.com>
---
Thomas, I just made you author since you provided the original code, hope
it's ok.

 include/linux/interrupt.h |  8 ++++++++
 kernel/irq/manage.c       | 19 +++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index ee8299eb1f52..870b3251e174 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -352,6 +352,8 @@ extern int irq_can_set_affinity(unsigned int irq);
 extern int irq_select_affinity(unsigned int irq);
 
 extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
+extern int irq_update_affinity_desc(unsigned int irq,
+				    struct irq_affinity_desc *affinity);
 
 extern int
 irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
@@ -387,6 +389,12 @@ static inline int irq_set_affinity_hint(unsigned int irq,
 	return -EINVAL;
 }
 
+static inline int irq_update_affinity_desc(unsigned int irq,
+					   struct irq_affinity_desc *affinity)
+{
+	return -EINVAL;
+}
+
 static inline int
 irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
 {
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index c460e0496006..b96af4cde4bc 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -371,6 +371,25 @@ int irq_set_affinity_locked(struct irq_data *data, const struct cpumask *mask,
 	return ret;
 }
 
+int irq_update_affinity_desc(unsigned int irq,
+			     struct irq_affinity_desc *affinity)
+{
+	unsigned long flags;
+	struct irq_desc *desc = irq_get_desc_lock(irq, &flags, 0);
+
+	if (!desc)
+		return -EINVAL;
+
+	if (affinity->is_managed) {
+		irqd_set(&desc->irq_data, IRQD_AFFINITY_MANAGED);
+		irqd_set(&desc->irq_data, IRQD_MANAGED_SHUTDOWN);
+	}
+
+	cpumask_copy(desc->irq_common_data.affinity, &affinity->mask);
+	irq_put_desc_unlock(desc, flags);
+	return 0;
+}
+
 int __irq_set_affinity(unsigned int irq, const struct cpumask *mask, bool force)
 {
 	struct irq_desc *desc = irq_to_desc(irq);
-- 
2.26.2


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

* [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity()
  2020-10-27 12:10 [PATCH 0/3] Support managed interrupts for platform devices John Garry
  2020-10-27 12:10 ` [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc() John Garry
@ 2020-10-27 12:10 ` John Garry
  2020-10-30  0:07   ` kernel test robot
  2020-10-27 12:10 ` [PATCH 3/3] scsi: hisi_sas: Expose HW queues for v2 hw John Garry
  2 siblings, 1 reply; 7+ messages in thread
From: John Garry @ 2020-10-27 12:10 UTC (permalink / raw)
  To: gregkh, rafael, martin.petersen, jejb, tglx
  Cc: linuxarm, linux-scsi, linux-kernel, maz, John Garry

Drivers for multi-queue platform devices may also want managed interrupts
for handling HW queue completion interrupts, so add support.

The function accepts an affinity descriptor pointer, which covers all IRQs
expected for the device.

The platform device driver is expected to hold all the IRQ numbers, as
there is no point in holding these in the common platform_device structure.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/base/platform.c         | 58 +++++++++++++++++++++++++++++++++
 include/linux/platform_device.h |  5 +++
 2 files changed, 63 insertions(+)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 88aef93eb4dd..c110b35469d6 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -269,6 +269,64 @@ int platform_get_irq(struct platform_device *dev, unsigned int num)
 }
 EXPORT_SYMBOL_GPL(platform_get_irq);
 
+/**
+ * platform_get_irqs_affinity - get all IRQs for a device using an affinity
+ *				descriptor
+ * @dev: platform device pointer
+ * @affd: affinity descriptor, must be set
+ * @count: pointer to count of IRQS
+ * @irqs: pointer holder for IRQ numbers
+ *
+ * Gets a full set of IRQs for a platform device, and updates IRQ afffinty
+ * according to the passed affinity descriptor
+ *
+ * Return: 0 on success, negative error number on failure.
+ */
+int platform_get_irqs_affinity(struct platform_device *dev,
+			       struct irq_affinity *affd,
+			       unsigned int *count,
+			       int **irqs)
+{
+	struct irq_affinity_desc *desc;
+	int i, *pirqs;
+
+	if (!affd)
+		return -EPERM;
+
+	*count = platform_irq_count(dev);
+
+	if (*count <= affd->pre_vectors + affd->post_vectors)
+		return -EIO;
+
+	pirqs = kcalloc(*count, sizeof(int), GFP_KERNEL);
+	if (!pirqs)
+		return -ENOMEM;
+
+	for (i = 0; i < *count; i++) {
+		int irq = platform_get_irq(dev, i);
+		if (irq < 0) {
+			kfree(pirqs);
+			return irq;
+		}
+		pirqs[i] = irq;
+	}
+
+	desc = irq_create_affinity_masks(*count, affd);
+	if (!desc) {
+		kfree(pirqs);
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < *count; i++)
+		irq_update_affinity_desc(pirqs[i], &desc[i]);
+
+	kfree(desc);
+	*irqs = pirqs;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(platform_get_irqs_affinity);
+
 /**
  * platform_irq_count - Count the number of IRQs a platform device uses
  * @dev: platform device
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 77a2aada106d..c3f4fc5a76b9 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -11,6 +11,7 @@
 #define _PLATFORM_DEVICE_H_
 
 #include <linux/device.h>
+#include <linux/interrupt.h>
 
 #define PLATFORM_DEVID_NONE	(-1)
 #define PLATFORM_DEVID_AUTO	(-2)
@@ -70,6 +71,10 @@ devm_platform_ioremap_resource_byname(struct platform_device *pdev,
 extern int platform_get_irq(struct platform_device *, unsigned int);
 extern int platform_get_irq_optional(struct platform_device *, unsigned int);
 extern int platform_irq_count(struct platform_device *);
+extern int platform_get_irqs_affinity(struct platform_device *dev,
+				      struct irq_affinity *affd,
+				      unsigned int *count,
+				      int **irqs);
 extern struct resource *platform_get_resource_byname(struct platform_device *,
 						     unsigned int,
 						     const char *);
-- 
2.26.2


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

* [PATCH 3/3] scsi: hisi_sas: Expose HW queues for v2 hw
  2020-10-27 12:10 [PATCH 0/3] Support managed interrupts for platform devices John Garry
  2020-10-27 12:10 ` [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc() John Garry
  2020-10-27 12:10 ` [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity() John Garry
@ 2020-10-27 12:10 ` John Garry
  2 siblings, 0 replies; 7+ messages in thread
From: John Garry @ 2020-10-27 12:10 UTC (permalink / raw)
  To: gregkh, rafael, martin.petersen, jejb, tglx
  Cc: linuxarm, linux-scsi, linux-kernel, maz, John Garry

As a performance enhancement, make the completion queue interrupts
managed.

In addition, in commit bf0beec0607d ("blk-mq: drain I/O when all CPUs in a
hctx are offline"), CPU hotplug for MQ devices using managed interrupts
is made safe. So expose HW queues to blk-mq to take advantage of this.

Flag Scsi_host.host_tagset is also set to ensure that the HBA is not sent
more commands than it can handle. However the driver still does not use
request tag for IPTT as there are many HW bugs which means that special
rules apply for IPTT allocation.

Signed-off-by: John Garry <john.garry@huawei.com>
---
 drivers/scsi/hisi_sas/hisi_sas.h       |  4 ++
 drivers/scsi/hisi_sas/hisi_sas_main.c  | 11 ++++
 drivers/scsi/hisi_sas/hisi_sas_v2_hw.c | 71 ++++++++++++++++++++++----
 3 files changed, 75 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
index a25cfc11c96d..33c4fb45dd99 100644
--- a/drivers/scsi/hisi_sas/hisi_sas.h
+++ b/drivers/scsi/hisi_sas/hisi_sas.h
@@ -14,6 +14,7 @@
 #include <linux/debugfs.h>
 #include <linux/dmapool.h>
 #include <linux/iopoll.h>
+#include <linux/irq.h>
 #include <linux/lcm.h>
 #include <linux/libata.h>
 #include <linux/mfd/syscon.h>
@@ -312,6 +313,7 @@ enum {
 
 struct hisi_sas_hw {
 	int (*hw_init)(struct hisi_hba *hisi_hba);
+	int (*interrupt_preinit)(struct hisi_hba *hisi_hba);
 	void (*setup_itct)(struct hisi_hba *hisi_hba,
 			   struct hisi_sas_device *device);
 	int (*slot_index_alloc)(struct hisi_hba *hisi_hba,
@@ -418,6 +420,8 @@ struct hisi_hba {
 	u32 refclk_frequency_mhz;
 	u8 sas_addr[SAS_ADDR_SIZE];
 
+	int irq_map[128]; /* v2 hw */
+
 	int n_phy;
 	spinlock_t lock;
 	struct semaphore sem;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 128583dfccf2..56f914203679 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -2614,6 +2614,13 @@ static struct Scsi_Host *hisi_sas_shost_alloc(struct platform_device *pdev,
 	return NULL;
 }
 
+static int hisi_sas_interrupt_preinit(struct hisi_hba *hisi_hba)
+{
+	if (hisi_hba->hw->interrupt_preinit)
+		return hisi_hba->hw->interrupt_preinit(hisi_hba);
+	return 0;
+}
+
 int hisi_sas_probe(struct platform_device *pdev,
 		   const struct hisi_sas_hw *hw)
 {
@@ -2671,6 +2678,10 @@ int hisi_sas_probe(struct platform_device *pdev,
 		sha->sas_port[i] = &hisi_hba->port[i].sas_port;
 	}
 
+	rc = hisi_sas_interrupt_preinit(hisi_hba);
+	if (rc)
+		goto err_out_ha;
+
 	rc = scsi_add_host(shost, &pdev->dev);
 	if (rc)
 		goto err_out_ha;
diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
index b57177b52fac..d6b933c3d0a2 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
@@ -3302,6 +3302,37 @@ static irq_handler_t fatal_interrupts[HISI_SAS_FATAL_INT_NR] = {
 	fatal_axi_int_v2_hw
 };
 
+static int hisi_sas_v2_interrupt_preinit(struct hisi_hba *hisi_hba)
+{
+	struct platform_device *pdev = hisi_hba->platform_dev;
+	struct Scsi_Host *shost = hisi_hba->shost;
+	int rc, i, *irqs, count;
+	struct irq_affinity desc = {
+		.pre_vectors = 96, /* base of completion queue interrupts */
+		.post_vectors = 16,
+	};
+
+	rc = platform_get_irqs_affinity(pdev, &desc, &count, &irqs);
+	if (rc < 0)
+		return rc;
+
+	/* 128 interrupts are always expected */
+	if (count != 128) {
+		kfree(irqs);
+		return -EIO;
+	}
+
+	/* Store the IRQ numbers in the driver */
+	for (i = 0; i < 128; i++)
+		hisi_hba->irq_map[i] = irqs[i];
+
+	shost->nr_hw_queues = hisi_hba->cq_nvecs = hisi_hba->queue_count;
+
+	kfree(irqs);
+
+	return 0;
+}
+
 /*
  * There is a limitation in the hip06 chipset that we need
  * to map in all mbigen interrupts, even if they are not used.
@@ -3310,14 +3341,11 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
 {
 	struct platform_device *pdev = hisi_hba->platform_dev;
 	struct device *dev = &pdev->dev;
-	int irq, rc = 0, irq_map[128];
+	int irq, rc = 0;
 	int i, phy_no, fatal_no, queue_no;
 
-	for (i = 0; i < 128; i++)
-		irq_map[i] = platform_get_irq(pdev, i);
-
 	for (i = 0; i < HISI_SAS_PHY_INT_NR; i++) {
-		irq = irq_map[i + 1]; /* Phy up/down is irq1 */
+		irq = hisi_hba->irq_map[i + 1]; /* Phy up/down is irq1 */
 		rc = devm_request_irq(dev, irq, phy_interrupts[i], 0,
 				      DRV_NAME " phy", hisi_hba);
 		if (rc) {
@@ -3331,7 +3359,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
 	for (phy_no = 0; phy_no < hisi_hba->n_phy; phy_no++) {
 		struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
 
-		irq = irq_map[phy_no + 72];
+		irq = hisi_hba->irq_map[phy_no + 72];
 		rc = devm_request_irq(dev, irq, sata_int_v2_hw, 0,
 				      DRV_NAME " sata", phy);
 		if (rc) {
@@ -3343,7 +3371,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
 	}
 
 	for (fatal_no = 0; fatal_no < HISI_SAS_FATAL_INT_NR; fatal_no++) {
-		irq = irq_map[fatal_no + 81];
+		irq = hisi_hba->irq_map[fatal_no + 81];
 		rc = devm_request_irq(dev, irq, fatal_interrupts[fatal_no], 0,
 				      DRV_NAME " fatal", hisi_hba);
 		if (rc) {
@@ -3357,7 +3385,7 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
 	for (queue_no = 0; queue_no < hisi_hba->queue_count; queue_no++) {
 		struct hisi_sas_cq *cq = &hisi_hba->cq[queue_no];
 
-		cq->irq_no = irq_map[queue_no + 96];
+		cq->irq_no = hisi_hba->irq_map[queue_no + 96];
 		rc = devm_request_threaded_irq(dev, cq->irq_no,
 					       cq_interrupt_v2_hw,
 					       cq_thread_v2_hw, IRQF_ONESHOT,
@@ -3368,10 +3396,8 @@ static int interrupt_init_v2_hw(struct hisi_hba *hisi_hba)
 			rc = -ENOENT;
 			goto err_out;
 		}
+		cq->irq_mask = irq_get_affinity_mask(cq->irq_no);
 	}
-
-	hisi_hba->cq_nvecs = hisi_hba->queue_count;
-
 err_out:
 	return rc;
 }
@@ -3529,6 +3555,26 @@ static struct device_attribute *host_attrs_v2_hw[] = {
 	NULL
 };
 
+static int map_queues_v2_hw(struct Scsi_Host *shost)
+{
+	struct hisi_hba *hisi_hba = shost_priv(shost);
+	struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
+	const struct cpumask *mask;
+	unsigned int queue, cpu;
+
+	for (queue = 0; queue < qmap->nr_queues; queue++) {
+		mask = irq_get_affinity_mask(hisi_hba->irq_map[96 + queue]);
+		if (!mask)
+			continue;
+
+		for_each_cpu(cpu, mask)
+			qmap->mq_map[cpu] = qmap->queue_offset + queue;
+	}
+
+	return 0;
+
+}
+
 static struct scsi_host_template sht_v2_hw = {
 	.name			= DRV_NAME,
 	.proc_name		= DRV_NAME,
@@ -3553,10 +3599,13 @@ static struct scsi_host_template sht_v2_hw = {
 #endif
 	.shost_attrs		= host_attrs_v2_hw,
 	.host_reset		= hisi_sas_host_reset,
+	.map_queues		= map_queues_v2_hw,
+	.host_tagset		= 1,
 };
 
 static const struct hisi_sas_hw hisi_sas_v2_hw = {
 	.hw_init = hisi_sas_v2_init,
+	.interrupt_preinit = hisi_sas_v2_interrupt_preinit,
 	.setup_itct = setup_itct_v2_hw,
 	.slot_index_alloc = slot_index_alloc_quirk_v2_hw,
 	.alloc_dev = alloc_dev_quirk_v2_hw,
-- 
2.26.2


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

* Re: [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc()
  2020-10-27 12:10 ` [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc() John Garry
@ 2020-10-27 15:22   ` Thomas Gleixner
  2020-10-27 16:40     ` John Garry
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2020-10-27 15:22 UTC (permalink / raw)
  To: John Garry, gregkh, rafael, martin.petersen, jejb
  Cc: linuxarm, linux-scsi, linux-kernel, maz, John Garry

John,

On Tue, Oct 27 2020 at 20:10, John Garry wrote:

> From: Thomas Gleixner <tglx@linutronix.de>
>
> Add a function to allow the affinity of an interrupt be switched to
> managed, such that interrupts allocated for platform devices may be
> managed.
>
> <Insert author sob>
>
> [jpg: Add commit message and add prototypes]
> Signed-off-by: John Garry <john.garry@huawei.com>
> ---
> Thomas, I just made you author since you provided the original code, hope
> it's ok.

I already forgot about this. And in fact I only gave you a broken
example. So just make yourself the author and add Suggested-by: tglx.

Vs. merging. I'd like to pick that up myself as I might have other
changes in that area coming up.

I'll do it as a single commit on top of rc1 and tag it so the scsi
people can just pull it in.

Thanks,

        tglx

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

* Re: [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc()
  2020-10-27 15:22   ` Thomas Gleixner
@ 2020-10-27 16:40     ` John Garry
  0 siblings, 0 replies; 7+ messages in thread
From: John Garry @ 2020-10-27 16:40 UTC (permalink / raw)
  To: Thomas Gleixner, gregkh, rafael, martin.petersen, jejb
  Cc: linuxarm, linux-scsi, linux-kernel, maz

Hi Thomas,

>> From: Thomas Gleixner <tglx@linutronix.de>
>>
>> Add a function to allow the affinity of an interrupt be switched to
>> managed, such that interrupts allocated for platform devices may be
>> managed.
>>
>> <Insert author sob>
>>
>> [jpg: Add commit message and add prototypes]
>> Signed-off-by: John Garry <john.garry@huawei.com>
>> ---
>> Thomas, I just made you author since you provided the original code, hope
>> it's ok.
> 
> I already forgot about this.

We needed some changes to go in to make the block CPU hotplug handling 
usable for some scsi drivers, which took a while.

> And in fact I only gave you a broken
> example. So just make yourself the author and add Suggested-by: tglx.
> 

ok, will repost with that, cheers

> Vs. merging. I'd like to pick that up myself as I might have other
> changes in that area coming up.
> 
> I'll do it as a single commit on top of rc1 and tag it so the scsi
> people can just pull it in.

I guess it's ok, I will defer to the maintainers on that.

Thanks,
John


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

* Re: [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity()
  2020-10-27 12:10 ` [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity() John Garry
@ 2020-10-30  0:07   ` kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-10-30  0:07 UTC (permalink / raw)
  To: John Garry, gregkh, rafael, martin.petersen, jejb, tglx
  Cc: kbuild-all, linuxarm, linux-scsi, linux-kernel, maz, John Garry

[-- Attachment #1: Type: text/plain, Size: 15157 bytes --]

Hi John,

I love your patch! Perhaps something to improve:

[auto build test WARNING on mkp-scsi/for-next]
[also build test WARNING on scsi/for-next tip/irq/core driver-core/driver-core-testing linus/master v5.10-rc1 next-20201029]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/John-Garry/Support-managed-interrupts-for-platform-devices/20201027-201557
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: h8300-randconfig-r025-20201029 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8675e033c5fd8a87c202e2bc74834122f010adc5
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review John-Garry/Support-managed-interrupts-for-platform-devices/20201027-201557
        git checkout 8675e033c5fd8a87c202e2bc74834122f010adc5
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=h8300 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from include/linux/mfd/core.h:13,
                    from drivers/mfd/88pm800.c:27:
>> include/linux/irqchip.h:31:42: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |                                          ^~~~~~~~~~~~~~~
--
   In file included from include/linux/irqchip.h:17,
                    from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from drivers/mfd/tps65217.c:21:
>> include/linux/platform_device.h:75:18: warning: 'struct irq_affinity' declared inside parameter list will not be visible outside of this definition or declaration
      75 |           struct irq_affinity *affd,
         |                  ^~~~~~~~~~~~
   In file included from include/linux/dev_printk.h:14,
                    from include/linux/device.h:15,
                    from drivers/mfd/tps65217.c:18:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
--
   In file included from include/linux/irqchip.h:17,
                    from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from drivers/mfd/max77650.c:10:
>> include/linux/platform_device.h:75:18: warning: 'struct irq_affinity' declared inside parameter list will not be visible outside of this definition or declaration
      75 |           struct irq_affinity *affd,
         |                  ^~~~~~~~~~~~
--
   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/module.h:12,
                    from drivers/mfd/si476x-prop.c:11:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from include/linux/mfd/core.h:13,
                    from include/linux/mfd/si476x-core.h:20,
                    from drivers/mfd/si476x-prop.c:13:
   include/linux/irqchip.h: At top level:
>> include/linux/irqchip.h:31:42: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |                                          ^~~~~~~~~~~~~~~
--
   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from include/linux/of_device.h:6,
                    from drivers/irqchip/irqchip.c:13:
>> include/linux/irqchip.h:31:42: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |                                          ^~~~~~~~~~~~~~~
   drivers/irqchip/irqchip.c:35:5: error: conflicting types for 'platform_irqchip_probe'
      35 | int platform_irqchip_probe(struct platform_device *pdev)
         |     ^~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from include/linux/of_device.h:6,
                    from drivers/irqchip/irqchip.c:13:
   include/linux/irqchip.h:31:12: note: previous declaration of 'platform_irqchip_probe' was here
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |            ^~~~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/linkage.h:7,
                    from include/linux/kernel.h:8,
                    from include/linux/list.h:9,
                    from include/linux/kobject.h:19,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from drivers/irqchip/irqchip.c:11:
   drivers/irqchip/irqchip.c:60:19: error: conflicting types for 'platform_irqchip_probe'
      60 | EXPORT_SYMBOL_GPL(platform_irqchip_probe);
         |                   ^~~~~~~~~~~~~~~~~~~~~~
   include/linux/export.h:98:21: note: in definition of macro '___EXPORT_SYMBOL'
      98 |  extern typeof(sym) sym;       \
         |                     ^~~
   include/linux/export.h:155:34: note: in expansion of macro '__EXPORT_SYMBOL'
     155 | #define _EXPORT_SYMBOL(sym, sec) __EXPORT_SYMBOL(sym, sec, "")
         |                                  ^~~~~~~~~~~~~~~
   include/linux/export.h:159:33: note: in expansion of macro '_EXPORT_SYMBOL'
     159 | #define EXPORT_SYMBOL_GPL(sym)  _EXPORT_SYMBOL(sym, "_gpl")
         |                                 ^~~~~~~~~~~~~~
   drivers/irqchip/irqchip.c:60:1: note: in expansion of macro 'EXPORT_SYMBOL_GPL'
      60 | EXPORT_SYMBOL_GPL(platform_irqchip_probe);
         | ^~~~~~~~~~~~~~~~~
   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from include/linux/of_device.h:6,
                    from drivers/irqchip/irqchip.c:13:
   include/linux/irqchip.h:31:12: note: previous declaration of 'platform_irqchip_probe' was here
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |            ^~~~~~~~~~~~~~~~~~~~~~
--
   In file included from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/platform_device.h:14,
                    from drivers/mfd/sm501.c:17:
>> include/linux/irqchip.h:31:42: warning: 'struct platform_device' declared inside parameter list will not be visible outside of this definition or declaration
      31 | extern int platform_irqchip_probe(struct platform_device *pdev);
         |                                          ^~~~~~~~~~~~~~~
   In file included from include/linux/kernel.h:11,
                    from drivers/mfd/sm501.c:11:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
--
   In file included from include/linux/dev_printk.h:14,
                    from include/linux/device.h:15,
                    from include/linux/spi/spi.h:9,
                    from drivers/mfd/stmpe-spi.c:10:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:93:50: warning: ordered comparison of pointer with null pointer [-Wextra]
      93 | #define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                  ^~
   include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
      78 | # define unlikely(x) __builtin_expect(!!(x), 0)
         |                                          ^
   include/linux/scatterlist.h:143:2: note: in expansion of macro 'BUG_ON'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |  ^~~~~~
   include/linux/scatterlist.h:143:10: note: in expansion of macro 'virt_addr_valid'
     143 |  BUG_ON(!virt_addr_valid(buf));
         |          ^~~~~~~~~~~~~~~
   In file included from include/linux/irqchip.h:17,
                    from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from drivers/mfd/stmpe-spi.c:11:
   include/linux/platform_device.h: At top level:
>> include/linux/platform_device.h:75:18: warning: 'struct irq_affinity' declared inside parameter list will not be visible outside of this definition or declaration
      75 |           struct irq_affinity *affd,
         |                  ^~~~~~~~~~~~
--
   In file included from include/linux/irqchip.h:17,
                    from arch/h8300/include/asm/irq.h:5,
                    from include/linux/irq.h:23,
                    from include/asm-generic/hardirq.h:13,
                    from ./arch/h8300/include/generated/asm/hardirq.h:1,
                    from include/linux/hardirq.h:10,
                    from include/linux/interrupt.h:11,
                    from include/linux/kernel_stat.h:9,
                    from arch/h8300/kernel/asm-offsets.c:14:
>> include/linux/platform_device.h:75:18: warning: 'struct irq_affinity' declared inside parameter list will not be visible outside of this definition or declaration
      75 |           struct irq_affinity *affd,
         |                  ^~~~~~~~~~~~
   <stdin>:1511:2: warning: #warning syscall clone3 not implemented [-Wcpp]

vim +31 include/linux/irqchip.h

91e20b5040c67c5 Joel Porquet    2015-07-02  30  
f8410e626569324 Saravana Kannan 2020-07-17 @31  extern int platform_irqchip_probe(struct platform_device *pdev);
f8410e626569324 Saravana Kannan 2020-07-17  32  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26624 bytes --]

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

end of thread, other threads:[~2020-10-30  0:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 12:10 [PATCH 0/3] Support managed interrupts for platform devices John Garry
2020-10-27 12:10 ` [PATCH 1/3] genirq/affinity: Add irq_update_affinity_desc() John Garry
2020-10-27 15:22   ` Thomas Gleixner
2020-10-27 16:40     ` John Garry
2020-10-27 12:10 ` [PATCH 2/3] Driver core: platform: Add platform_get_irqs_affinity() John Garry
2020-10-30  0:07   ` kernel test robot
2020-10-27 12:10 ` [PATCH 3/3] scsi: hisi_sas: Expose HW queues for v2 hw John Garry

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).