Skip to contentSkip to conversation

fpga: mgr: add FPGA configuration log

PATCH In review [email protected] 3 participants 9 messages Apr 2, 2019 – Apr 3, 2019 FPGA manager framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fpga: mgr: add FPGA configuration log

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
 drivers/fpga/fpga-mgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +1 -0
index c386681..559e046 100644
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
 	}
 	mgr->state = FPGA_MGR_STATE_OPERATING;
 
+	dev_info(&mgr->dev, "Successfully programming FPGA\n");
 	return 0;
 }
 
Signature · 1 line
2.7.4
maintainer
#1 lore raw

Hi Richard,

Quoted 14 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
 drivers/fpga/fpga-mgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 154

Quoted 4 lines
drivers/fpga/fpga-mgr.c +1 -0
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
 	}
 	mgr->state = FPGA_MGR_STATE_OPERATING;
 
+	dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

From my end I don't see how we need this really.

Thanks,
Moritz

#2 lore raw
Quoted 21 lines · Moritz Fischer

Hi Richard,

Quoted 17 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
 drivers/fpga/fpga-mgr.c | 1 +
 1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
      }
      mgr->state = FPGA_MGR_STATE_OPERATING;
 
Quoted 6 lines

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 154

Quoted 1 line
drivers/fpga/fpga-mgr.c +1 -0
+     dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

From my end I don't see how we need this really.

I'm ok with adding a message. It's not adding lots of messages, just one line for an event that will only happen for people who care about the event (not too many FPGA users but if someone is using FPGA, they will care about this.)

Alan

Quoted 3 lines

Thanks,
Moritz

#3 lore raw
In reply to Moritz Fischer

Hi Moritz,

Quoted 20 lines · Moritz Fischer

Hi Richard,

Quoted 17 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
  drivers/fpga/fpga-mgr.c | 1 +
  1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
  	}
  	mgr->state = FPGA_MGR_STATE_OPERATING;
 
Quoted 6 lines

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 154

Quoted 1 line
drivers/fpga/fpga-mgr.c +1 -0
+	dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

From my end I don't see how we need this really.

We got requests from the field and they want to see a log to get know if FPGA configuration is successfully completed. They don't want use any additional command to get status.

This log is useful for the user who performs FPGA configuration.

I think we need use dev_info, since dev_dbg is not enabled by fault for most build.

Quoted 4 lines

Thanks,
Moritz

maintainer
#4 lore raw

Hi Richard,

Quoted 30 lines · Richard Gong

Hi Moritz,

Quoted 24 lines · Moritz Fischer

Hi Richard,

Quoted 14 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
  drivers/fpga/fpga-mgr.c | 1 +
  1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 153

Quoted 3 lines
drivers/fpga/fpga-mgr.c +1 -0
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
  	}
  	mgr->state = FPGA_MGR_STATE_OPERATING;
+	dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

Quoted 1 line

From my end I don't see how we need this really.

Quoted 8 lines

We got requests from the field and they want to see a log to get know if FPGA configuration is successfully completed. They don't want use any additional command to get status.

This log is useful for the user who performs FPGA configuration.

I think we need use dev_info, since dev_dbg is not enabled by fault for most build.

Well basically it boils down to:

$ dmesg | grep "Sucessfully"

vs

$ cat /sys/class/fpga.../status 

Personally not in favor of extra messages, but if we do it we should change the message to "Sucessfully programmed FPGA".

I think making it a dbg message is a good trade-off ...

Moritz

#5 lore raw
Quoted 43 lines · Moritz Fischer

Hi Richard,

Quoted 30 lines · Richard Gong

Hi Moritz,

Quoted 24 lines · Moritz Fischer

Hi Richard,

Quoted 14 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
  drivers/fpga/fpga-mgr.c | 1 +
  1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 153

Quoted 3 lines
drivers/fpga/fpga-mgr.c +1 -0
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
          }
          mgr->state = FPGA_MGR_STATE_OPERATING;
+ dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

Quoted 1 line

From my end I don't see how we need this really.

Quoted 8 lines

We got requests from the field and they want to see a log to get know if FPGA configuration is successfully completed. They don't want use any additional command to get status.

This log is useful for the user who performs FPGA configuration.

I think we need use dev_info, since dev_dbg is not enabled by fault for most build.

Quoted 7 lines

Well basically it boils down to:

$ dmesg | grep "Sucessfully"

vs

$ cat /sys/class/fpga.../status

it's state, not status for most fpga manager drivers. It should return 'operating' if everything went well.

It seems like there's a possible scenario where the FPGA starts up with the FPGA in 'operating' mode and the user messes up early enough that the state doesn't change.

Quoted 7 lines

Personally not in favor of extra messages, but if we do it we should change the message to "Sucessfully programmed FPGA".

I think making it a dbg message is a good trade-off ...

Moritz

#6 lore raw
Quoted 51 lines · Alan Tull
Quoted 49 lines · Moritz Fischer

Hi Richard,

Quoted 30 lines · Richard Gong

Hi Moritz,

Quoted 24 lines · Moritz Fischer

Hi Richard,

Quoted 14 lines · On Tue, Apr 02, 2019 at 05:25:43PM -0500, [email protected] wrote:

From: Richard Gong <[email protected]>

Add a log for user to know FPGA configuration is successful

---
  drivers/fpga/fpga-mgr.c | 1 +
  1 file changed, 1 insertion(+)
drivers/fpga/fpga-mgr.c +0 -0
index c386681..559e046 100644

drivers/fpga/fpga-mgr.c static int fpga_mgr_write_complete(struct fpga_manager *mgr, · line 153

Quoted 3 lines
drivers/fpga/fpga-mgr.c +1 -0
@@ -151,6 +151,7 @@ static int fpga_mgr_write_complete(struct fpga_manager *mgr,
          }
          mgr->state = FPGA_MGR_STATE_OPERATING;
+ dev_info(&mgr->dev, "Successfully programming FPGA\n");

That info is available in FPGA manager's sysfs status entry, if at all I'd make this a dev_dbg().

Quoted 1 line

From my end I don't see how we need this really.

Quoted 8 lines

We got requests from the field and they want to see a log to get know if FPGA configuration is successfully completed. They don't want use any additional command to get status.

This log is useful for the user who performs FPGA configuration.

I think we need use dev_info, since dev_dbg is not enabled by fault for most build.

Well basically it boils down to:

$ dmesg | grep "Sucessfully"

vs

Quoted 14 lines
Quoted 1 line
$ cat /sys/class/fpga.../status

it's state, not status for most fpga manager drivers. It should return 'operating' if everything went well.

It seems like there's a possible scenario where the FPGA starts up with the FPGA in 'operating' mode and the user messes up early enough that the state doesn't change.

Quoted 5 lines

Personally not in favor of extra messages, but if we do it we should change the message to "Sucessfully programmed FPGA".

I think making it a dbg message is a good trade-off ...

dbg vs info... On the one hand, it is a usually a message the developer wants to see so the developer would turn on debug messages. But then again FPGA programming doesn't happen that often and it is a kind of significant event since it is your hardware changing i.e. it won't add a lot messages, but it is sort of an important one if it
happens. If the system crashes after a FPGA reprogramming event, it
would be good to have this in the log by default. I don't want to argue too powerfully for adding extra messages though. Is this a case where info is worth it since fpga programming is significant?

Quoted 2 lines
Quoted 2 lines

Moritz

maintainer
#7 lore raw
Quoted 3 lines · Alan Tull
Quoted 3 lines

it's state, not status for most fpga manager drivers. It should return 'operating' if everything went well.

Yeah, sorry :)

Quoted 3 lines
Quoted 3 lines

It seems like there's a possible scenario where the FPGA starts up with the FPGA in 'operating' mode and the user messes up early enough that the state doesn't change.

Huh, then we should fix that instead? :)

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

Personally not in favor of extra messages, but if we do it we should change the message to "Sucessfully programmed FPGA".

I think making it a dbg message is a good trade-off ...

Quoted 9 lines

dbg vs info... On the one hand, it is a usually a message the developer wants to see so the developer would turn on debug messages. But then again FPGA programming doesn't happen that often and it is a kind of significant event since it is your hardware changing i.e. it won't add a lot messages, but it is sort of an important one if it
happens. If the system crashes after a FPGA reprogramming event, it
would be good to have this in the log by default. I don't want to argue too powerfully for adding extra messages though. Is this a case where info is worth it since fpga programming is significant?

In the current setup, it doesn't happen often. Going forward people might have use-cases where this happens a lot more often.

I mean if y'all feel like this is required, sure, I still feel people shouldn't rely on dmesg output for functional verification :)

I don't wanna guarantee that this message is gonna be there always ...

Cheers,
Moritz

#8 lore raw
Quoted 30 lines · Moritz Fischer
Quoted 3 lines · Alan Tull
Quoted 3 lines

it's state, not status for most fpga manager drivers. It should return 'operating' if everything went well.

Yeah, sorry :)

Quoted 3 lines
Quoted 3 lines

It seems like there's a possible scenario where the FPGA starts up with the FPGA in 'operating' mode and the user messes up early enough that the state doesn't change.

Huh, then we should fix that instead? :)

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

Personally not in favor of extra messages, but if we do it we should change the message to "Sucessfully programmed FPGA".

I think making it a dbg message is a good trade-off ...

Quoted 9 lines

dbg vs info... On the one hand, it is a usually a message the developer wants to see so the developer would turn on debug messages. But then again FPGA programming doesn't happen that often and it is a kind of significant event since it is your hardware changing i.e. it won't add a lot messages, but it is sort of an important one if it
happens. If the system crashes after a FPGA reprogramming event, it
would be good to have this in the log by default. I don't want to argue too powerfully for adding extra messages though. Is this a case where info is worth it since fpga programming is significant?

Quoted 2 lines

In the current setup, it doesn't happen often. Going forward people might have use-cases where this happens a lot more often.

Yes, then adding the message could become very spammy.

Quoted 3 lines

I mean if y'all feel like this is required, sure, I still feel people shouldn't rely on dmesg output for functional verification :)

I agree with you that using sysfs to see what state the FPGA mgr ended up in should be adequate most of the time. We probably don't need this.

Quoted 2 lines

I don't wanna guarantee that this message is gonna be there always ...

Indeed...

Thanks,
Alan

Quoted 3 lines

Cheers,
Moritz