Skip to contentSkip to conversation

linux-next: build failure after merge of the scsi-mkp tree

PATCH Stephen Rothwell 4 participants 6 messages Dec 8, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the scsi-mkp tree, today's linux-next build (sparc64 defconfig) failed like this:

drivers/mtd/nand/raw/intel-nand-controller.c:17:10: fatal error: linux/mtd/nand_ecc.h: No such file or directory
17 | #include <linux/mtd/nand_ecc.h>

      |          ^~~~~~~~~~~~~~~~~~~~~~

Caused by commit

81a395cdc176 ("scsi: block: Do not accept any requests while suspended")

# CONFIG_PM is not set

I have applied the following patch:

From: Stephen Rothwell <[email protected]>
Date: Tue, 8 Dec 2020 20:12:33 +1100
Subject: [PATCH] scsi: block: fix for "scsi: block: Do not accept any requests while suspended"

Fixes 81a395cdc176 ("scsi: block: Do not accept any requests while suspended")
---
 block/blk-core.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
block/blk-core.c +14 -4
index a71a5c9429d6..9c9aec1382be 100644
@@ -421,6 +421,18 @@ void blk_cleanup_queue(struct request_queue *q)
 }
 EXPORT_SYMBOL(blk_cleanup_queue);
 
+#ifdef CONFIG_PM
+static bool rq_suspended(struct request_queue *q)
+{
+	return q->rpm_status == RPM_SUSPENDED;
+}
+#else
+static bool rq_suspended(struct request_queue *q)
+{
+	return false;
+}
+#endif
+
 /**
  * blk_queue_enter() - try to increase q->q_usage_counter
  * @q: request queue pointer
@@ -440,12 +452,10 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 			 * responsible for ensuring that that counter is
 			 * globally visible before the queue is unfrozen.
 			 */
-			if ((pm && q->rpm_status != RPM_SUSPENDED) ||
-			    !blk_queue_pm_only(q)) {
+			if ((pm && !rq_suspended(q)) || !blk_queue_pm_only(q))
 				success = true;
-			} else {
+			else
 				percpu_ref_put(&q->q_usage_counter);
-			}
 		}
 		rcu_read_unlock();
 
Signature · 7 lines
2.29.2



-- 
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 7 lines · Stephen Rothwell

Hi all,

After merging the scsi-mkp tree, today's linux-next build (sparc64 defconfig) failed like this:

drivers/mtd/nand/raw/intel-nand-controller.c:17:10: fatal error: linux/mtd/nand_ecc.h: No such file or directory
17 | #include <linux/mtd/nand_ecc.h>

The error message doesn't match up with your proposed solution.

#2 lore raw

Hi Christoph,

Quoted 11 lines · On Tue, 8 Dec 2020 10:30:39 +0100 Christoph Hellwig <[email protected]> wrote:
Quoted 7 lines · Stephen Rothwell

Hi all,

After merging the scsi-mkp tree, today's linux-next build (sparc64 defconfig) failed like this:

drivers/mtd/nand/raw/intel-nand-controller.c:17:10: fatal error: linux/mtd/nand_ecc.h: No such file or directory
17 | #include <linux/mtd/nand_ecc.h>

The error message doesn't match up with your proposed solution.

Yeah, semi automation gone wrong :-)

Signature · 2 lines
Cheers,
Stephen Rothwell
#3 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 9 lines · On Tue, 8 Dec 2020 20:28:53 +1100 Stephen Rothwell <[email protected]> wrote:

Hi all,

After merging the scsi-mkp tree, today's linux-next build (sparc64 defconfig) failed like this:

drivers/mtd/nand/raw/intel-nand-controller.c:17:10: fatal error: linux/mtd/nand_ecc.h: No such file or directory
17 | #include <linux/mtd/nand_ecc.h>

      |          ^~~~~~~~~~~~~~~~~~~~~~

Clearly, it did not fail like that :-)

block/blk-core.c: In function 'blk_queue_enter':
block/blk-core.c:443:18: error: 'struct request_queue' has no member named 'rpm_status'; did you mean 'stats'?

    if ((pm && q->rpm_status != RPM_SUSPENDED) ||
                  ^~~~~~~~~~
                  stats
Quoted 58 lines

Caused by commit

81a395cdc176 ("scsi: block: Do not accept any requests while suspended")

# CONFIG_PM is not set

I have applied the following patch:

From: Stephen Rothwell <[email protected]>
Date: Tue, 8 Dec 2020 20:12:33 +1100
Subject: [PATCH] scsi: block: fix for "scsi: block: Do not accept any requests while suspended"

Fixes 81a395cdc176 ("scsi: block: Do not accept any requests while suspended")
---
 block/blk-core.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
block/blk-core.c +14 -4
index a71a5c9429d6..9c9aec1382be 100644
@@ -421,6 +421,18 @@ void blk_cleanup_queue(struct request_queue *q)
 }
 EXPORT_SYMBOL(blk_cleanup_queue);
 
+#ifdef CONFIG_PM
+static bool rq_suspended(struct request_queue *q)
+{
+	return q->rpm_status == RPM_SUSPENDED;
+}
+#else
+static bool rq_suspended(struct request_queue *q)
+{
+	return false;
+}
+#endif
+
 /**
  * blk_queue_enter() - try to increase q->q_usage_counter
  * @q: request queue pointer
@@ -440,12 +452,10 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 			 * responsible for ensuring that that counter is
 			 * globally visible before the queue is unfrozen.
 			 */
-			if ((pm && q->rpm_status != RPM_SUSPENDED) ||
-			    !blk_queue_pm_only(q)) {
+			if ((pm && !rq_suspended(q)) || !blk_queue_pm_only(q))
 				success = true;
-			} else {
+			else
 				percpu_ref_put(&q->q_usage_counter);
-			}
 		}
 		rcu_read_unlock();
 
Signature · 1 line
2.29.2
Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw
Quoted 68 lines · Stephen Rothwell

Hi all,

Quoted 9 lines · On Tue, 8 Dec 2020 20:28:53 +1100 Stephen Rothwell <[email protected]> wrote:

Hi all,

After merging the scsi-mkp tree, today's linux-next build (sparc64 defconfig) failed like this:

drivers/mtd/nand/raw/intel-nand-controller.c:17:10: fatal error: linux/mtd/nand_ecc.h: No such file or directory
17 | #include <linux/mtd/nand_ecc.h>

      |          ^~~~~~~~~~~~~~~~~~~~~~

Clearly, it did not fail like that :-)

block/blk-core.c: In function 'blk_queue_enter':
block/blk-core.c:443:18: error: 'struct request_queue' has no member named 'rpm_status'; did you mean 'stats'?

    if ((pm && q->rpm_status != RPM_SUSPENDED) ||
                  ^~~~~~~~~~
                  stats
Quoted 47 lines

Caused by commit

81a395cdc176 ("scsi: block: Do not accept any requests while suspended")

# CONFIG_PM is not set

I have applied the following patch:

From: Stephen Rothwell <[email protected]>
Date: Tue, 8 Dec 2020 20:12:33 +1100
Subject: [PATCH] scsi: block: fix for "scsi: block: Do not accept any requests while suspended"

Fixes 81a395cdc176 ("scsi: block: Do not accept any requests while suspended")
---
 block/blk-core.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
block/blk-core.c +12 -2
index a71a5c9429d6..9c9aec1382be 100644
@@ -421,6 +421,18 @@ void blk_cleanup_queue(struct request_queue *q)
 }
 EXPORT_SYMBOL(blk_cleanup_queue);
 
+#ifdef CONFIG_PM
+static bool rq_suspended(struct request_queue *q)
+{
+	return q->rpm_status == RPM_SUSPENDED;
+}
+#else
+static bool rq_suspended(struct request_queue *q)
+{
+	return false;
+}
+#endif
+
 /**
  * blk_queue_enter() - try to increase q->q_usage_counter
  * @q: request queue pointer
@@ -440,12 +452,10 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
 			 * responsible for ensuring that that counter is
 			 * globally visible before the queue is unfrozen.
 			 */
-			if ((pm && q->rpm_status != RPM_SUSPENDED) ||
-			    !blk_queue_pm_only(q)) {
Quoted 8 lines

block/blk-core.c int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) · line 460

Quoted 8 lines
block/blk-core.c +2 -2
+			if ((pm && !rq_suspended(q)) || !blk_queue_pm_only(q))
 				success = true;
-			} else {
+			else
 				percpu_ref_put(&q->q_usage_counter);
-			}
 		}
 		rcu_read_unlock();

Yes, that certainly is the proper fix. It's all to easy to miss these issues that depend on your kernel configuration.

Bart, can you fold it into a new version of the patch?

Alan Stern

#5 lore raw
Quoted 4 lines · Alan Stern

Yes, that certainly is the proper fix. It's all to easy to miss these issues that depend on your kernel configuration.

Bart, can you fold it into a new version of the patch?

Sure, I will do that.

Thanks,

Bart.