All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:58 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: amd-gfx, dri-devel, linux-kernel, intel-gfx, nouveau, linux-pci,
	kvm, loongson-kernel

From: Sui Jingfeng <suijingfeng@loongson.cn>

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

* [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:58 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

* [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:58 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

* [Nouveau] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:58 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

* [PATCH v2 2/2] vgaarb: introduce is_boot_device callback function to vga_client_register
  2023-06-04 20:58 ` Sui Jingfeng
  (?)
  (?)
@ 2023-06-04 20:58   ` Sui Jingfeng
  -1 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: amd-gfx, dri-devel, linux-kernel, intel-gfx, nouveau, linux-pci,
	kvm, loongson-kernel

From: Sui Jingfeng <suijingfeng@loongson.cn>

The vga_is_firmware_default() function is arch-dependent, which dosen't
sound right. At least, It also works on Mips and LoongArch platform with
the drm/AMDGPU and drm/radeon driver. However, it's difficult to enumerate
all Arch-driver combination. I'm wrong if there are only one exception.

With the observation that device drivers typically has better knowledge
about which PCI bar contains the firmware framebuffer, Which could helps
to avoids the need to iterate all of the PCI BARs. But As a PCI core
function at pci/vgaarb.c, vga_is_firmware_default funciton is embarrasing
to make optimization for a specific device.

There also has PCI display controller don't has a dedicated VRAM bar in
the world, this function will lost the effectiveness on such a case.

Luckily, device driver can do the accurate workaround. We add a callback
then, to let the device driver make the decision. Device drivers know what
archs it could works, device driver also can shipping this decision to
whatever arch its device can reach, not only the X86 and IA64.

Also honor the comment: "Clients have two callback mechanisms they can use"

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/i915/display/intel_vga.c   |  3 +--
 drivers/gpu/drm/nouveau/nouveau_vga.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_device.c     |  2 +-
 drivers/pci/vgaarb.c                       | 22 ++++++++++++++++++----
 drivers/vfio/pci/vfio_pci_core.c           |  2 +-
 include/linux/vgaarb.h                     |  8 +++++---
 7 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5c7d40873ee2..7a096f2d5c16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3960,7 +3960,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
 	if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
-		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode);
+		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode, NULL);
 
 	px = amdgpu_device_supports_px(ddev);
 
diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index 286a0bdd28c6..98d7d4dffe9f 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -115,7 +115,6 @@ intel_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
 
 int intel_vga_register(struct drm_i915_private *i915)
 {
-
 	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
 	int ret;
 
@@ -127,7 +126,7 @@ int intel_vga_register(struct drm_i915_private *i915)
 	 * then we do not take part in VGA arbitration and the
 	 * vga_client_register() fails with -ENODEV.
 	 */
-	ret = vga_client_register(pdev, intel_vga_set_decode);
+	ret = vga_client_register(pdev, intel_vga_set_decode, NULL);
 	if (ret && ret != -ENODEV)
 		return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index f8bf0ec26844..162b4f4676c7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -92,7 +92,7 @@ nouveau_vga_init(struct nouveau_drm *drm)
 		return;
 	pdev = to_pci_dev(dev->dev);
 
-	vga_client_register(pdev, nouveau_vga_set_decode);
+	vga_client_register(pdev, nouveau_vga_set_decode, NULL);
 
 	/* don't register Thunderbolt eGPU with vga_switcheroo */
 	if (pci_is_thunderbolt_attached(pdev))
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index afbb3a80c0c6..71f2ff39d6a1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1425,7 +1425,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	/* if we have > 1 VGA cards, then disable the radeon VGA resources */
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
-	vga_client_register(rdev->pdev, radeon_vga_set_decode);
+	vga_client_register(rdev->pdev, radeon_vga_set_decode, NULL);
 
 	if (rdev->flags & RADEON_IS_PX)
 		runtime = true;
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index e40e6e5e5f03..4576c4197551 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -53,6 +53,7 @@ struct vga_device {
 	bool bridge_has_one_vga;
 	bool is_firmware_default;	/* device selected by firmware */
 	unsigned int (*set_decode)(struct pci_dev *pdev, bool decode);
+	bool (*is_boot_device)(struct pci_dev *pdev);
 };
 
 static LIST_HEAD(vga_list);
@@ -615,10 +616,17 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
 	if (boot_vga && boot_vga->is_firmware_default)
 		return false;
 
-	if (vga_is_firmware_default(pdev)) {
-		vgadev->is_firmware_default = true;
+	/*
+	 * Ask the device driver first, if registered. Fallback to the
+	 * default implement if the callback is non-exist.
+	 */
+	if (vgadev->is_boot_device)
+		vgadev->is_firmware_default = vgadev->is_boot_device(pdev);
+	else
+		vgadev->is_firmware_default = vga_is_firmware_default(pdev);
+
+	if (vgadev->is_firmware_default)
 		return true;
-	}
 
 	/*
 	 * A legacy VGA device has MEM and IO enabled and any bridges
@@ -958,6 +966,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
+ * @is_boot_device: callback to the device driver, query if a client is the
+ * default boot device, as the device driver typically has better knowledge
+ * if specific device is the boot device. But this callback is optional.
+ *
  * Rationale: we cannot disable VGA decode resources unconditionally, some
  * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
  * to control things like backlights etc. Hopefully newer multi-GPU laptops do
@@ -973,7 +985,8 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * Returns: 0 on success, -1 on failure
  */
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	int ret = -ENODEV;
 	struct vga_device *vgadev;
@@ -985,6 +998,7 @@ int vga_client_register(struct pci_dev *pdev,
 		goto bail;
 
 	vgadev->set_decode = set_decode;
+	vgadev->is_boot_device = is_boot_device;
 	ret = 0;
 
 bail:
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index a5ab416cf476..2a8873a330ba 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -2067,7 +2067,7 @@ static int vfio_pci_vga_init(struct vfio_pci_core_device *vdev)
 	if (ret)
 		return ret;
 
-	ret = vga_client_register(pdev, vfio_pci_set_decode);
+	ret = vga_client_register(pdev, vfio_pci_set_decode, NULL);
 	if (ret)
 		return ret;
 	vga_set_legacy_decoding(pdev, vfio_pci_set_decode(pdev, false));
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index d36225c582ee..66fe80ffad76 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -50,7 +50,8 @@ struct pci_dev *vga_default_device(void);
 void vga_set_default_device(struct pci_dev *pdev);
 int vga_remove_vgacon(struct pci_dev *pdev);
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state));
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev));
 #else /* CONFIG_VGA_ARB */
 static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 		unsigned int decodes)
@@ -76,7 +77,8 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev)
 	return 0;
 }
 static inline int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	return 0;
 }
@@ -114,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
 {
-	vga_client_register(pdev, NULL);
+	vga_client_register(pdev, NULL, NULL);
 }
 
 #endif /* LINUX_VGA_H */
-- 
2.25.1


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

* [PATCH v2 2/2] vgaarb: introduce is_boot_device callback function to vga_client_register
@ 2023-06-04 20:58   ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

The vga_is_firmware_default() function is arch-dependent, which dosen't
sound right. At least, It also works on Mips and LoongArch platform with
the drm/AMDGPU and drm/radeon driver. However, it's difficult to enumerate
all Arch-driver combination. I'm wrong if there are only one exception.

With the observation that device drivers typically has better knowledge
about which PCI bar contains the firmware framebuffer, Which could helps
to avoids the need to iterate all of the PCI BARs. But As a PCI core
function at pci/vgaarb.c, vga_is_firmware_default funciton is embarrasing
to make optimization for a specific device.

There also has PCI display controller don't has a dedicated VRAM bar in
the world, this function will lost the effectiveness on such a case.

Luckily, device driver can do the accurate workaround. We add a callback
then, to let the device driver make the decision. Device drivers know what
archs it could works, device driver also can shipping this decision to
whatever arch its device can reach, not only the X86 and IA64.

Also honor the comment: "Clients have two callback mechanisms they can use"

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/i915/display/intel_vga.c   |  3 +--
 drivers/gpu/drm/nouveau/nouveau_vga.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_device.c     |  2 +-
 drivers/pci/vgaarb.c                       | 22 ++++++++++++++++++----
 drivers/vfio/pci/vfio_pci_core.c           |  2 +-
 include/linux/vgaarb.h                     |  8 +++++---
 7 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5c7d40873ee2..7a096f2d5c16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3960,7 +3960,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
 	if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
-		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode);
+		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode, NULL);
 
 	px = amdgpu_device_supports_px(ddev);
 
diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index 286a0bdd28c6..98d7d4dffe9f 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -115,7 +115,6 @@ intel_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
 
 int intel_vga_register(struct drm_i915_private *i915)
 {
-
 	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
 	int ret;
 
@@ -127,7 +126,7 @@ int intel_vga_register(struct drm_i915_private *i915)
 	 * then we do not take part in VGA arbitration and the
 	 * vga_client_register() fails with -ENODEV.
 	 */
-	ret = vga_client_register(pdev, intel_vga_set_decode);
+	ret = vga_client_register(pdev, intel_vga_set_decode, NULL);
 	if (ret && ret != -ENODEV)
 		return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index f8bf0ec26844..162b4f4676c7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -92,7 +92,7 @@ nouveau_vga_init(struct nouveau_drm *drm)
 		return;
 	pdev = to_pci_dev(dev->dev);
 
-	vga_client_register(pdev, nouveau_vga_set_decode);
+	vga_client_register(pdev, nouveau_vga_set_decode, NULL);
 
 	/* don't register Thunderbolt eGPU with vga_switcheroo */
 	if (pci_is_thunderbolt_attached(pdev))
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index afbb3a80c0c6..71f2ff39d6a1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1425,7 +1425,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	/* if we have > 1 VGA cards, then disable the radeon VGA resources */
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
-	vga_client_register(rdev->pdev, radeon_vga_set_decode);
+	vga_client_register(rdev->pdev, radeon_vga_set_decode, NULL);
 
 	if (rdev->flags & RADEON_IS_PX)
 		runtime = true;
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index e40e6e5e5f03..4576c4197551 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -53,6 +53,7 @@ struct vga_device {
 	bool bridge_has_one_vga;
 	bool is_firmware_default;	/* device selected by firmware */
 	unsigned int (*set_decode)(struct pci_dev *pdev, bool decode);
+	bool (*is_boot_device)(struct pci_dev *pdev);
 };
 
 static LIST_HEAD(vga_list);
@@ -615,10 +616,17 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
 	if (boot_vga && boot_vga->is_firmware_default)
 		return false;
 
-	if (vga_is_firmware_default(pdev)) {
-		vgadev->is_firmware_default = true;
+	/*
+	 * Ask the device driver first, if registered. Fallback to the
+	 * default implement if the callback is non-exist.
+	 */
+	if (vgadev->is_boot_device)
+		vgadev->is_firmware_default = vgadev->is_boot_device(pdev);
+	else
+		vgadev->is_firmware_default = vga_is_firmware_default(pdev);
+
+	if (vgadev->is_firmware_default)
 		return true;
-	}
 
 	/*
 	 * A legacy VGA device has MEM and IO enabled and any bridges
@@ -958,6 +966,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
+ * @is_boot_device: callback to the device driver, query if a client is the
+ * default boot device, as the device driver typically has better knowledge
+ * if specific device is the boot device. But this callback is optional.
+ *
  * Rationale: we cannot disable VGA decode resources unconditionally, some
  * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
  * to control things like backlights etc. Hopefully newer multi-GPU laptops do
@@ -973,7 +985,8 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * Returns: 0 on success, -1 on failure
  */
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	int ret = -ENODEV;
 	struct vga_device *vgadev;
@@ -985,6 +998,7 @@ int vga_client_register(struct pci_dev *pdev,
 		goto bail;
 
 	vgadev->set_decode = set_decode;
+	vgadev->is_boot_device = is_boot_device;
 	ret = 0;
 
 bail:
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index a5ab416cf476..2a8873a330ba 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -2067,7 +2067,7 @@ static int vfio_pci_vga_init(struct vfio_pci_core_device *vdev)
 	if (ret)
 		return ret;
 
-	ret = vga_client_register(pdev, vfio_pci_set_decode);
+	ret = vga_client_register(pdev, vfio_pci_set_decode, NULL);
 	if (ret)
 		return ret;
 	vga_set_legacy_decoding(pdev, vfio_pci_set_decode(pdev, false));
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index d36225c582ee..66fe80ffad76 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -50,7 +50,8 @@ struct pci_dev *vga_default_device(void);
 void vga_set_default_device(struct pci_dev *pdev);
 int vga_remove_vgacon(struct pci_dev *pdev);
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state));
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev));
 #else /* CONFIG_VGA_ARB */
 static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 		unsigned int decodes)
@@ -76,7 +77,8 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev)
 	return 0;
 }
 static inline int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	return 0;
 }
@@ -114,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
 {
-	vga_client_register(pdev, NULL);
+	vga_client_register(pdev, NULL, NULL);
 }
 
 #endif /* LINUX_VGA_H */
-- 
2.25.1


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

* [Intel-gfx] [PATCH v2 2/2] vgaarb: introduce is_boot_device callback function to vga_client_register
@ 2023-06-04 20:58   ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

The vga_is_firmware_default() function is arch-dependent, which dosen't
sound right. At least, It also works on Mips and LoongArch platform with
the drm/AMDGPU and drm/radeon driver. However, it's difficult to enumerate
all Arch-driver combination. I'm wrong if there are only one exception.

With the observation that device drivers typically has better knowledge
about which PCI bar contains the firmware framebuffer, Which could helps
to avoids the need to iterate all of the PCI BARs. But As a PCI core
function at pci/vgaarb.c, vga_is_firmware_default funciton is embarrasing
to make optimization for a specific device.

There also has PCI display controller don't has a dedicated VRAM bar in
the world, this function will lost the effectiveness on such a case.

Luckily, device driver can do the accurate workaround. We add a callback
then, to let the device driver make the decision. Device drivers know what
archs it could works, device driver also can shipping this decision to
whatever arch its device can reach, not only the X86 and IA64.

Also honor the comment: "Clients have two callback mechanisms they can use"

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/i915/display/intel_vga.c   |  3 +--
 drivers/gpu/drm/nouveau/nouveau_vga.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_device.c     |  2 +-
 drivers/pci/vgaarb.c                       | 22 ++++++++++++++++++----
 drivers/vfio/pci/vfio_pci_core.c           |  2 +-
 include/linux/vgaarb.h                     |  8 +++++---
 7 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5c7d40873ee2..7a096f2d5c16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3960,7 +3960,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
 	if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
-		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode);
+		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode, NULL);
 
 	px = amdgpu_device_supports_px(ddev);
 
diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index 286a0bdd28c6..98d7d4dffe9f 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -115,7 +115,6 @@ intel_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
 
 int intel_vga_register(struct drm_i915_private *i915)
 {
-
 	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
 	int ret;
 
@@ -127,7 +126,7 @@ int intel_vga_register(struct drm_i915_private *i915)
 	 * then we do not take part in VGA arbitration and the
 	 * vga_client_register() fails with -ENODEV.
 	 */
-	ret = vga_client_register(pdev, intel_vga_set_decode);
+	ret = vga_client_register(pdev, intel_vga_set_decode, NULL);
 	if (ret && ret != -ENODEV)
 		return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index f8bf0ec26844..162b4f4676c7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -92,7 +92,7 @@ nouveau_vga_init(struct nouveau_drm *drm)
 		return;
 	pdev = to_pci_dev(dev->dev);
 
-	vga_client_register(pdev, nouveau_vga_set_decode);
+	vga_client_register(pdev, nouveau_vga_set_decode, NULL);
 
 	/* don't register Thunderbolt eGPU with vga_switcheroo */
 	if (pci_is_thunderbolt_attached(pdev))
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index afbb3a80c0c6..71f2ff39d6a1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1425,7 +1425,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	/* if we have > 1 VGA cards, then disable the radeon VGA resources */
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
-	vga_client_register(rdev->pdev, radeon_vga_set_decode);
+	vga_client_register(rdev->pdev, radeon_vga_set_decode, NULL);
 
 	if (rdev->flags & RADEON_IS_PX)
 		runtime = true;
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index e40e6e5e5f03..4576c4197551 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -53,6 +53,7 @@ struct vga_device {
 	bool bridge_has_one_vga;
 	bool is_firmware_default;	/* device selected by firmware */
 	unsigned int (*set_decode)(struct pci_dev *pdev, bool decode);
+	bool (*is_boot_device)(struct pci_dev *pdev);
 };
 
 static LIST_HEAD(vga_list);
@@ -615,10 +616,17 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
 	if (boot_vga && boot_vga->is_firmware_default)
 		return false;
 
-	if (vga_is_firmware_default(pdev)) {
-		vgadev->is_firmware_default = true;
+	/*
+	 * Ask the device driver first, if registered. Fallback to the
+	 * default implement if the callback is non-exist.
+	 */
+	if (vgadev->is_boot_device)
+		vgadev->is_firmware_default = vgadev->is_boot_device(pdev);
+	else
+		vgadev->is_firmware_default = vga_is_firmware_default(pdev);
+
+	if (vgadev->is_firmware_default)
 		return true;
-	}
 
 	/*
 	 * A legacy VGA device has MEM and IO enabled and any bridges
@@ -958,6 +966,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
+ * @is_boot_device: callback to the device driver, query if a client is the
+ * default boot device, as the device driver typically has better knowledge
+ * if specific device is the boot device. But this callback is optional.
+ *
  * Rationale: we cannot disable VGA decode resources unconditionally, some
  * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
  * to control things like backlights etc. Hopefully newer multi-GPU laptops do
@@ -973,7 +985,8 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * Returns: 0 on success, -1 on failure
  */
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	int ret = -ENODEV;
 	struct vga_device *vgadev;
@@ -985,6 +998,7 @@ int vga_client_register(struct pci_dev *pdev,
 		goto bail;
 
 	vgadev->set_decode = set_decode;
+	vgadev->is_boot_device = is_boot_device;
 	ret = 0;
 
 bail:
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index a5ab416cf476..2a8873a330ba 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -2067,7 +2067,7 @@ static int vfio_pci_vga_init(struct vfio_pci_core_device *vdev)
 	if (ret)
 		return ret;
 
-	ret = vga_client_register(pdev, vfio_pci_set_decode);
+	ret = vga_client_register(pdev, vfio_pci_set_decode, NULL);
 	if (ret)
 		return ret;
 	vga_set_legacy_decoding(pdev, vfio_pci_set_decode(pdev, false));
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index d36225c582ee..66fe80ffad76 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -50,7 +50,8 @@ struct pci_dev *vga_default_device(void);
 void vga_set_default_device(struct pci_dev *pdev);
 int vga_remove_vgacon(struct pci_dev *pdev);
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state));
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev));
 #else /* CONFIG_VGA_ARB */
 static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 		unsigned int decodes)
@@ -76,7 +77,8 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev)
 	return 0;
 }
 static inline int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	return 0;
 }
@@ -114,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
 {
-	vga_client_register(pdev, NULL);
+	vga_client_register(pdev, NULL, NULL);
 }
 
 #endif /* LINUX_VGA_H */
-- 
2.25.1


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

* [Nouveau] [PATCH v2 2/2] vgaarb: introduce is_boot_device callback function to vga_client_register
@ 2023-06-04 20:58   ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:58 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

From: Sui Jingfeng <suijingfeng@loongson.cn>

The vga_is_firmware_default() function is arch-dependent, which dosen't
sound right. At least, It also works on Mips and LoongArch platform with
the drm/AMDGPU and drm/radeon driver. However, it's difficult to enumerate
all Arch-driver combination. I'm wrong if there are only one exception.

With the observation that device drivers typically has better knowledge
about which PCI bar contains the firmware framebuffer, Which could helps
to avoids the need to iterate all of the PCI BARs. But As a PCI core
function at pci/vgaarb.c, vga_is_firmware_default funciton is embarrasing
to make optimization for a specific device.

There also has PCI display controller don't has a dedicated VRAM bar in
the world, this function will lost the effectiveness on such a case.

Luckily, device driver can do the accurate workaround. We add a callback
then, to let the device driver make the decision. Device drivers know what
archs it could works, device driver also can shipping this decision to
whatever arch its device can reach, not only the X86 and IA64.

Also honor the comment: "Clients have two callback mechanisms they can use"

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  2 +-
 drivers/gpu/drm/i915/display/intel_vga.c   |  3 +--
 drivers/gpu/drm/nouveau/nouveau_vga.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_device.c     |  2 +-
 drivers/pci/vgaarb.c                       | 22 ++++++++++++++++++----
 drivers/vfio/pci/vfio_pci_core.c           |  2 +-
 include/linux/vgaarb.h                     |  8 +++++---
 7 files changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5c7d40873ee2..7a096f2d5c16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3960,7 +3960,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
 	if ((adev->pdev->class >> 8) == PCI_CLASS_DISPLAY_VGA)
-		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode);
+		vga_client_register(adev->pdev, amdgpu_device_vga_set_decode, NULL);
 
 	px = amdgpu_device_supports_px(ddev);
 
diff --git a/drivers/gpu/drm/i915/display/intel_vga.c b/drivers/gpu/drm/i915/display/intel_vga.c
index 286a0bdd28c6..98d7d4dffe9f 100644
--- a/drivers/gpu/drm/i915/display/intel_vga.c
+++ b/drivers/gpu/drm/i915/display/intel_vga.c
@@ -115,7 +115,6 @@ intel_vga_set_decode(struct pci_dev *pdev, bool enable_decode)
 
 int intel_vga_register(struct drm_i915_private *i915)
 {
-
 	struct pci_dev *pdev = to_pci_dev(i915->drm.dev);
 	int ret;
 
@@ -127,7 +126,7 @@ int intel_vga_register(struct drm_i915_private *i915)
 	 * then we do not take part in VGA arbitration and the
 	 * vga_client_register() fails with -ENODEV.
 	 */
-	ret = vga_client_register(pdev, intel_vga_set_decode);
+	ret = vga_client_register(pdev, intel_vga_set_decode, NULL);
 	if (ret && ret != -ENODEV)
 		return ret;
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c
index f8bf0ec26844..162b4f4676c7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_vga.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vga.c
@@ -92,7 +92,7 @@ nouveau_vga_init(struct nouveau_drm *drm)
 		return;
 	pdev = to_pci_dev(dev->dev);
 
-	vga_client_register(pdev, nouveau_vga_set_decode);
+	vga_client_register(pdev, nouveau_vga_set_decode, NULL);
 
 	/* don't register Thunderbolt eGPU with vga_switcheroo */
 	if (pci_is_thunderbolt_attached(pdev))
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index afbb3a80c0c6..71f2ff39d6a1 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -1425,7 +1425,7 @@ int radeon_device_init(struct radeon_device *rdev,
 	/* if we have > 1 VGA cards, then disable the radeon VGA resources */
 	/* this will fail for cards that aren't VGA class devices, just
 	 * ignore it */
-	vga_client_register(rdev->pdev, radeon_vga_set_decode);
+	vga_client_register(rdev->pdev, radeon_vga_set_decode, NULL);
 
 	if (rdev->flags & RADEON_IS_PX)
 		runtime = true;
diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index e40e6e5e5f03..4576c4197551 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -53,6 +53,7 @@ struct vga_device {
 	bool bridge_has_one_vga;
 	bool is_firmware_default;	/* device selected by firmware */
 	unsigned int (*set_decode)(struct pci_dev *pdev, bool decode);
+	bool (*is_boot_device)(struct pci_dev *pdev);
 };
 
 static LIST_HEAD(vga_list);
@@ -615,10 +616,17 @@ static bool vga_is_boot_device(struct vga_device *vgadev)
 	if (boot_vga && boot_vga->is_firmware_default)
 		return false;
 
-	if (vga_is_firmware_default(pdev)) {
-		vgadev->is_firmware_default = true;
+	/*
+	 * Ask the device driver first, if registered. Fallback to the
+	 * default implement if the callback is non-exist.
+	 */
+	if (vgadev->is_boot_device)
+		vgadev->is_firmware_default = vgadev->is_boot_device(pdev);
+	else
+		vgadev->is_firmware_default = vga_is_firmware_default(pdev);
+
+	if (vgadev->is_firmware_default)
 		return true;
-	}
 
 	/*
 	 * A legacy VGA device has MEM and IO enabled and any bridges
@@ -958,6 +966,10 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
+ * @is_boot_device: callback to the device driver, query if a client is the
+ * default boot device, as the device driver typically has better knowledge
+ * if specific device is the boot device. But this callback is optional.
+ *
  * Rationale: we cannot disable VGA decode resources unconditionally, some
  * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
  * to control things like backlights etc. Hopefully newer multi-GPU laptops do
@@ -973,7 +985,8 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * Returns: 0 on success, -1 on failure
  */
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool decode),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	int ret = -ENODEV;
 	struct vga_device *vgadev;
@@ -985,6 +998,7 @@ int vga_client_register(struct pci_dev *pdev,
 		goto bail;
 
 	vgadev->set_decode = set_decode;
+	vgadev->is_boot_device = is_boot_device;
 	ret = 0;
 
 bail:
diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c
index a5ab416cf476..2a8873a330ba 100644
--- a/drivers/vfio/pci/vfio_pci_core.c
+++ b/drivers/vfio/pci/vfio_pci_core.c
@@ -2067,7 +2067,7 @@ static int vfio_pci_vga_init(struct vfio_pci_core_device *vdev)
 	if (ret)
 		return ret;
 
-	ret = vga_client_register(pdev, vfio_pci_set_decode);
+	ret = vga_client_register(pdev, vfio_pci_set_decode, NULL);
 	if (ret)
 		return ret;
 	vga_set_legacy_decoding(pdev, vfio_pci_set_decode(pdev, false));
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index d36225c582ee..66fe80ffad76 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -50,7 +50,8 @@ struct pci_dev *vga_default_device(void);
 void vga_set_default_device(struct pci_dev *pdev);
 int vga_remove_vgacon(struct pci_dev *pdev);
 int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state));
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev));
 #else /* CONFIG_VGA_ARB */
 static inline void vga_set_legacy_decoding(struct pci_dev *pdev,
 		unsigned int decodes)
@@ -76,7 +77,8 @@ static inline int vga_remove_vgacon(struct pci_dev *pdev)
 	return 0;
 }
 static inline int vga_client_register(struct pci_dev *pdev,
-		unsigned int (*set_decode)(struct pci_dev *pdev, bool state))
+		unsigned int (*set_decode)(struct pci_dev *pdev, bool state),
+		bool (*is_boot_device)(struct pci_dev *pdev))
 {
 	return 0;
 }
@@ -114,7 +116,7 @@ static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
 {
-	vga_client_register(pdev, NULL);
+	vga_client_register(pdev, NULL, NULL);
 }
 
 #endif /* LINUX_VGA_H */
-- 
2.25.1


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

* [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/2] vgaarb: various coding style and comments fix
  2023-06-04 20:58 ` Sui Jingfeng
                   ` (3 preceding siblings ...)
  (?)
@ 2023-06-04 21:45 ` Patchwork
  -1 siblings, 0 replies; 42+ messages in thread
From: Patchwork @ 2023-06-04 21:45 UTC (permalink / raw)
  To: Sui Jingfeng; +Cc: intel-gfx

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

== Series Details ==

Series: series starting with [v2,1/2] vgaarb: various coding style and comments fix
URL   : https://patchwork.freedesktop.org/series/118846/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_13226 -> Patchwork_118846v1
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/index.html

Participating hosts (37 -> 36)
------------------------------

  Missing    (1): fi-snb-2520m 

Known issues
------------

  Here are the changes found in Patchwork_118846v1 that come from known issues:

### CI changes ###

#### Issues hit ####

  * boot:
    - fi-kbl-8809g:       [PASS][1] -> [FAIL][2] ([i915#8293] / [i915#8298])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/fi-kbl-8809g/boot.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/fi-kbl-8809g/boot.html

  

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@hangcheck:
    - bat-dg2-11:         [PASS][3] -> [ABORT][4] ([i915#7913] / [i915#7979])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/bat-dg2-11/igt@i915_selftest@live@hangcheck.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/bat-dg2-11/igt@i915_selftest@live@hangcheck.html

  * igt@i915_selftest@live@requests:
    - bat-rpls-1:         [PASS][5] -> [ABORT][6] ([i915#7911] / [i915#7920] / [i915#7982])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/bat-rpls-1/igt@i915_selftest@live@requests.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/bat-rpls-1/igt@i915_selftest@live@requests.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - fi-skl-6600u:       NOTRUN -> [SKIP][7] ([fdo#109271])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/fi-skl-6600u/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1:
    - bat-dg2-8:          [PASS][8] -> [FAIL][9] ([i915#7932]) +1 similar issue
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-c-dp-1.html

  
#### Possible fixes ####

  * igt@gem_exec_suspend@basic-s3@smem:
    - {bat-mtlp-8}:       [FAIL][10] ([fdo#103375]) -> [PASS][11] +6 similar issues
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/bat-mtlp-8/igt@gem_exec_suspend@basic-s3@smem.html
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/bat-mtlp-8/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_pm_rpm@basic-pci-d3-state:
    - fi-hsw-4770:        [SKIP][12] ([fdo#109271]) -> [PASS][13]
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/fi-hsw-4770/igt@i915_pm_rpm@basic-pci-d3-state.html

  * igt@i915_pm_rpm@basic-rte:
    - fi-hsw-4770:        [FAIL][14] ([i915#7364]) -> [PASS][15]
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/fi-hsw-4770/igt@i915_pm_rpm@basic-rte.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/fi-hsw-4770/igt@i915_pm_rpm@basic-rte.html

  * igt@i915_selftest@live@execlists:
    - fi-skl-6600u:       [ABORT][16] -> [PASS][17]
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/fi-skl-6600u/igt@i915_selftest@live@execlists.html
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/fi-skl-6600u/igt@i915_selftest@live@execlists.html

  
#### Warnings ####

  * igt@kms_psr@primary_mmap_gtt:
    - bat-rplp-1:         [SKIP][18] ([i915#1072]) -> [ABORT][19] ([i915#8442])
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/bat-rplp-1/igt@kms_psr@primary_mmap_gtt.html
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/bat-rplp-1/igt@kms_psr@primary_mmap_gtt.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#7364]: https://gitlab.freedesktop.org/drm/intel/issues/7364
  [i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7920]: https://gitlab.freedesktop.org/drm/intel/issues/7920
  [i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
  [i915#7979]: https://gitlab.freedesktop.org/drm/intel/issues/7979
  [i915#7982]: https://gitlab.freedesktop.org/drm/intel/issues/7982
  [i915#8293]: https://gitlab.freedesktop.org/drm/intel/issues/8293
  [i915#8298]: https://gitlab.freedesktop.org/drm/intel/issues/8298
  [i915#8442]: https://gitlab.freedesktop.org/drm/intel/issues/8442


Build changes
-------------

  * Linux: CI_DRM_13226 -> Patchwork_118846v1

  CI-20190529: 20190529
  CI_DRM_13226: 29c0f369e17ba0abf08c65ca065417aebab208c6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7318: c2d8ef8b9397d0976959f29dc1dd7c8a698d65fe @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_118846v1: 29c0f369e17ba0abf08c65ca065417aebab208c6 @ git://anongit.freedesktop.org/gfx-ci/linux


### Linux commits

5b85afe09e25 vgaarb: introduce is_boot_device callback function to vga_client_register
328b12dc8787 vgaarb: various coding style and comments fix

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/index.html

[-- Attachment #2: Type: text/html, Size: 6777 bytes --]

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-04 20:58 ` Sui Jingfeng
                     ` (2 preceding siblings ...)
  (?)
@ 2023-06-05 22:16   ` Andi Shyti
  -1 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-05 22:16 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu,
	kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

Hi Sui,

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.

I think the real reason is not to keep consistent with
vga_iostate_to_str() but because vga_str_to_iostate() is actually
only taking "unsigned int *" parameters.

> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -

drop this change

>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)

this is OK, it's actually what you are describing in the commit
log, but...

>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

... all the rest needs to go on different patches as it doesn't
have anything to do with what you describe.

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-05 22:16   ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-05 22:16 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Bokun Zhang,
	intel-gfx, Maxime Ripard, loongson-kernel, Alex Williamson,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Thomas Zimmermann,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Hi Sui,

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.

I think the real reason is not to keep consistent with
vga_iostate_to_str() but because vga_str_to_iostate() is actually
only taking "unsigned int *" parameters.

> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -

drop this change

>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)

this is OK, it's actually what you are describing in the commit
log, but...

>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

... all the rest needs to go on different patches as it doesn't
have anything to do with what you describe.

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-05 22:16   ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-05 22:16 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, David Airlie,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maxime Ripard, loongson-kernel,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Thomas Zimmermann, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Hi Sui,

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.

I think the real reason is not to keep consistent with
vga_iostate_to_str() but because vga_str_to_iostate() is actually
only taking "unsigned int *" parameters.

> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -

drop this change

>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)

this is OK, it's actually what you are describing in the commit
log, but...

>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

... all the rest needs to go on different patches as it doesn't
have anything to do with what you describe.

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-05 22:16   ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-05 22:16 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, Sui Jingfeng,
	David Airlie, Ville Syrjala, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, linux-pci, Andrey Grodzovsky,
	Kevin Tian, Lijo Lazar, Daniel Vetter, Bokun Zhang, intel-gfx,
	Maarten Lankhorst, Maxime Ripard, loongson-kernel,
	Alex Williamson, Abhishek Sahu, Jani Nikula, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Thomas Zimmermann, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi Sui,

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.

I think the real reason is not to keep consistent with
vga_iostate_to_str() but because vga_str_to_iostate() is actually
only taking "unsigned int *" parameters.

> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -

drop this change

>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)

this is OK, it's actually what you are describing in the commit
log, but...

>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

... all the rest needs to go on different patches as it doesn't
have anything to do with what you describe.

Andi

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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-05 22:16   ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-05 22:16 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Ville Syrjala,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi Sui,

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.

I think the real reason is not to keep consistent with
vga_iostate_to_str() but because vga_str_to_iostate() is actually
only taking "unsigned int *" parameters.

> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -

drop this change

>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)

this is OK, it's actually what you are describing in the commit
log, but...

>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

... all the rest needs to go on different patches as it doesn't
have anything to do with what you describe.

Andi

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

* [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [v2,1/2] vgaarb: various coding style and comments fix
  2023-06-04 20:58 ` Sui Jingfeng
                   ` (5 preceding siblings ...)
  (?)
@ 2023-06-06  1:05 ` Patchwork
  -1 siblings, 0 replies; 42+ messages in thread
From: Patchwork @ 2023-06-06  1:05 UTC (permalink / raw)
  To: Sui Jingfeng; +Cc: intel-gfx

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

== Series Details ==

Series: series starting with [v2,1/2] vgaarb: various coding style and comments fix
URL   : https://patchwork.freedesktop.org/series/118846/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_13226_full -> Patchwork_118846v1_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_118846v1_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_118846v1_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Participating hosts (7 -> 7)
------------------------------

  No changes in participating hosts

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_118846v1_full:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_cursor_legacy@single-move@pipe-a:
    - shard-snb:          [PASS][1] -> [INCOMPLETE][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-snb1/igt@kms_cursor_legacy@single-move@pipe-a.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb7/igt@kms_cursor_legacy@single-move@pipe-a.html

  * igt@kms_flip@2x-flip-vs-fences-interruptible@ab-vga1-hdmi-a1:
    - shard-snb:          NOTRUN -> [DMESG-FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb1/igt@kms_flip@2x-flip-vs-fences-interruptible@ab-vga1-hdmi-a1.html

  * igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-1:
    - shard-apl:          [PASS][4] -> [INCOMPLETE][5]
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-apl2/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-1.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl1/igt@kms_pipe_crc_basic@suspend-read-crc@pipe-a-dp-1.html

  
Known issues
------------

  Here are the changes found in Patchwork_118846v1_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@drm_read@short-buffer-block:
    - shard-snb:          [PASS][6] -> [SKIP][7] ([fdo#109271])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-snb1/igt@drm_read@short-buffer-block.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb7/igt@drm_read@short-buffer-block.html

  * igt@gem_exec_fair@basic-none-solo@rcs0:
    - shard-apl:          [PASS][8] -> [FAIL][9] ([i915#2842])
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-apl4/igt@gem_exec_fair@basic-none-solo@rcs0.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl3/igt@gem_exec_fair@basic-none-solo@rcs0.html

  * igt@gem_lmem_swapping@verify-random:
    - shard-apl:          NOTRUN -> [SKIP][10] ([fdo#109271] / [i915#4613])
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl4/igt@gem_lmem_swapping@verify-random.html

  * igt@gem_pwrite@basic-exhaustion:
    - shard-apl:          NOTRUN -> [WARN][11] ([i915#2658])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl1/igt@gem_pwrite@basic-exhaustion.html

  * igt@i915_pipe_stress@stress-xrgb8888-ytiled:
    - shard-apl:          NOTRUN -> [FAIL][12] ([i915#7036])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl4/igt@i915_pipe_stress@stress-xrgb8888-ytiled.html

  * igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-vga:
    - shard-snb:          NOTRUN -> [SKIP][13] ([fdo#109271] / [i915#4579]) +11 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb6/igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-vga.html

  * igt@kms_async_flips@alternate-sync-async-flip@pipe-b-hdmi-a-1:
    - shard-glk:          [PASS][14] -> [FAIL][15] ([i915#2521])
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-glk2/igt@kms_async_flips@alternate-sync-async-flip@pipe-b-hdmi-a-1.html
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-glk7/igt@kms_async_flips@alternate-sync-async-flip@pipe-b-hdmi-a-1.html

  * igt@kms_ccs@pipe-a-bad-rotation-90-y_tiled_gen12_mc_ccs:
    - shard-apl:          NOTRUN -> [SKIP][16] ([fdo#109271] / [i915#3886]) +1 similar issue
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl4/igt@kms_ccs@pipe-a-bad-rotation-90-y_tiled_gen12_mc_ccs.html

  * igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_gen12_mc_ccs:
    - shard-apl:          NOTRUN -> [SKIP][17] ([fdo#109271]) +57 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl4/igt@kms_ccs@pipe-d-bad-pixel-format-y_tiled_gen12_mc_ccs.html

  * igt@kms_cursor_crc@cursor-sliding-32x32:
    - shard-apl:          NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#4579]) +7 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl1/igt@kms_cursor_crc@cursor-sliding-32x32.html

  * igt@kms_flip@2x-flip-vs-expired-vblank@bc-hdmi-a1-hdmi-a2:
    - shard-glk:          [PASS][19] -> [FAIL][20] ([i915#79])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-glk7/igt@kms_flip@2x-flip-vs-expired-vblank@bc-hdmi-a1-hdmi-a2.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-glk5/igt@kms_flip@2x-flip-vs-expired-vblank@bc-hdmi-a1-hdmi-a2.html

  * igt@kms_plane_scaling@planes-downscale-factor-0-75@pipe-a-hdmi-a-1:
    - shard-snb:          NOTRUN -> [SKIP][21] ([fdo#109271]) +30 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb1/igt@kms_plane_scaling@planes-downscale-factor-0-75@pipe-a-hdmi-a-1.html

  * igt@kms_psr2_sf@cursor-plane-update-sf:
    - shard-apl:          NOTRUN -> [SKIP][22] ([fdo#109271] / [i915#658])
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl4/igt@kms_psr2_sf@cursor-plane-update-sf.html

  
#### Possible fixes ####

  * igt@api_intel_allocator@default-alignment:
    - {shard-dg1}:        [DMESG-WARN][23] ([i915#4423]) -> [PASS][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-dg1-16/igt@api_intel_allocator@default-alignment.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-dg1-18/igt@api_intel_allocator@default-alignment.html

  * igt@gem_eio@kms:
    - {shard-tglu}:       [INCOMPLETE][25] -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-tglu-2/igt@gem_eio@kms.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-tglu-7/igt@gem_eio@kms.html

  * igt@gem_exec_fair@basic-flow@rcs0:
    - {shard-tglu}:       [FAIL][27] ([i915#2842]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-tglu-8/igt@gem_exec_fair@basic-flow@rcs0.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-tglu-8/igt@gem_exec_fair@basic-flow@rcs0.html

  * igt@gem_exec_fair@basic-pace-solo@rcs0:
    - {shard-rkl}:        [FAIL][29] ([i915#2842]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-rkl-1/igt@gem_exec_fair@basic-pace-solo@rcs0.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-rkl-1/igt@gem_exec_fair@basic-pace-solo@rcs0.html

  * igt@gem_exec_whisper@basic-fds-forked-all:
    - {shard-tglu}:       [INCOMPLETE][31] ([i915#6755] / [i915#7392]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-tglu-8/igt@gem_exec_whisper@basic-fds-forked-all.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-tglu-8/igt@gem_exec_whisper@basic-fds-forked-all.html

  * igt@i915_pm_rc6_residency@rc6-idle@vcs0:
    - {shard-dg1}:        [FAIL][33] ([i915#3591]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-dg1-18/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-dg1-13/igt@i915_pm_rc6_residency@rc6-idle@vcs0.html

  * igt@i915_pm_rps@reset:
    - shard-snb:          [DMESG-FAIL][35] ([i915#8319]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-snb1/igt@i915_pm_rps@reset.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb6/igt@i915_pm_rps@reset.html

  * igt@i915_selftest@live@gt_heartbeat:
    - shard-apl:          [ABORT][37] -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-apl3/igt@i915_selftest@live@gt_heartbeat.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl1/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_cursor_crc@cursor-suspend@pipe-a-dp-1:
    - shard-apl:          [ABORT][39] ([i915#180]) -> [PASS][40] +1 similar issue
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-apl6/igt@kms_cursor_crc@cursor-suspend@pipe-a-dp-1.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-apl6/igt@kms_cursor_crc@cursor-suspend@pipe-a-dp-1.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
    - shard-glk:          [FAIL][41] ([i915#2346]) -> [PASS][42] +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-glk4/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-glk6/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html

  
#### Warnings ####

  * igt@kms_hdmi_inject@inject-audio:
    - shard-snb:          [FAIL][43] ([IGT#3]) -> [SKIP][44] ([fdo#109271])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-snb1/igt@kms_hdmi_inject@inject-audio.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb2/igt@kms_hdmi_inject@inject-audio.html

  * igt@kms_plane_multiple@tiling-yf:
    - shard-snb:          [SKIP][45] ([fdo#109271] / [i915#4579]) -> [SKIP][46] ([fdo#109271])
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13226/shard-snb1/igt@kms_plane_multiple@tiling-yf.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/shard-snb7/igt@kms_plane_multiple@tiling-yf.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [IGT#3]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/3
  [fdo#103375]: https://bugs.freedesktop.org/show_bug.cgi?id=103375
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
  [fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
  [fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
  [fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
  [fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
  [fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
  [fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
  [fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
  [fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
  [i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
  [i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1902]: https://gitlab.freedesktop.org/drm/intel/issues/1902
  [i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
  [i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
  [i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
  [i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
  [i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
  [i915#2658]: https://gitlab.freedesktop.org/drm/intel/issues/2658
  [i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
  [i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
  [i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
  [i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
  [i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
  [i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
  [i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
  [i915#3361]: https://gitlab.freedesktop.org/drm/intel/issues/3361
  [i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
  [i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
  [i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
  [i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
  [i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
  [i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
  [i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
  [i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
  [i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
  [i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
  [i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
  [i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
  [i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
  [i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
  [i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
  [i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
  [i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
  [i915#4423]: https://gitlab.freedesktop.org/drm/intel/issues/4423
  [i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
  [i915#4565]: https://gitlab.freedesktop.org/drm/intel/issues/4565
  [i915#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
  [i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
  [i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
  [i915#4816]: https://gitlab.freedesktop.org/drm/intel/issues/4816
  [i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
  [i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
  [i915#4879]: https://gitlab.freedesktop.org/drm/intel/issues/4879
  [i915#4936]: https://gitlab.freedesktop.org/drm/intel/issues/4936
  [i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
  [i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
  [i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
  [i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#5493]: https://gitlab.freedesktop.org/drm/intel/issues/5493
  [i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
  [i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
  [i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
  [i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
  [i915#6755]: https://gitlab.freedesktop.org/drm/intel/issues/6755
  [i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
  [i915#7036]: https://gitlab.freedesktop.org/drm/intel/issues/7036
  [i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
  [i915#7392]: https://gitlab.freedesktop.org/drm/intel/issues/7392
  [i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
  [i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
  [i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
  [i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
  [i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
  [i915#8213]: https://gitlab.freedesktop.org/drm/intel/issues/8213
  [i915#8319]: https://gitlab.freedesktop.org/drm/intel/issues/8319
  [i915#8381]: https://gitlab.freedesktop.org/drm/intel/issues/8381
  [i915#8414]: https://gitlab.freedesktop.org/drm/intel/issues/8414


Build changes
-------------

  * Linux: CI_DRM_13226 -> Patchwork_118846v1

  CI-20190529: 20190529
  CI_DRM_13226: 29c0f369e17ba0abf08c65ca065417aebab208c6 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_7318: c2d8ef8b9397d0976959f29dc1dd7c8a698d65fe @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
  Patchwork_118846v1: 29c0f369e17ba0abf08c65ca065417aebab208c6 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_118846v1/index.html

[-- Attachment #2: Type: text/html, Size: 14545 bytes --]

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-05 22:16   ` Andi Shyti
                       ` (2 preceding siblings ...)
  (?)
@ 2023-06-06  2:06     ` Sui Jingfeng
  -1 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06  2:06 UTC (permalink / raw)
  To: Andi Shyti, Sui Jingfeng
  Cc: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Jason Gunthorpe, Kevin Tian,
	Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu, kvm, nouveau,
	intel-gfx, linux-kernel, dri-devel, loongson-kernel, amd-gfx,
	linux-pci

Hi,

On 2023/6/6 06:16, Andi Shyti wrote:
> Hi Sui,
>
> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
> I think the real reason is not to keep consistent with
> vga_iostate_to_str() but because vga_str_to_iostate() is actually
> only taking "unsigned int *" parameters.

Yes, right.

my expression is not completely correct, I will update it at next version.


I think, we have the same opinion.

Originally, I also want to express the opinion.

Because, it make no sense to  interpret the return value

(VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type.


IO state should be should be donate by a unsigned type.

vga_iostate_to_str() also receive unsigned type.

static const char *vga_iostate_to_str(unsigned int iostate)

>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
> drop this change

OK,

This is a double blank line.

Originally, I intend to accumulate all tiny fix, commit together.

As they are trivial.

Now, Should I split this patch,

then this patch set will contain two trivial patch ?

>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
> this is OK, it's actually what you are describing in the commit
> log, but...
>
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> ... all the rest needs to go on different patches as it doesn't
> have anything to do with what you describe.

OK,

I will wait a few days for more reviews,

I process them together,   also avoid version grow too fast.

Thanks.

> Andi

-- 
Jingfeng


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06  2:06     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06  2:06 UTC (permalink / raw)
  To: Andi Shyti, Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, linux-pci, Andrey Grodzovsky,
	Kevin Tian, Lijo Lazar, Bokun Zhang, intel-gfx, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Thomas Zimmermann, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 06:16, Andi Shyti wrote:
> Hi Sui,
>
> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
> I think the real reason is not to keep consistent with
> vga_iostate_to_str() but because vga_str_to_iostate() is actually
> only taking "unsigned int *" parameters.

Yes, right.

my expression is not completely correct, I will update it at next version.


I think, we have the same opinion.

Originally, I also want to express the opinion.

Because, it make no sense to  interpret the return value

(VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type.


IO state should be should be donate by a unsigned type.

vga_iostate_to_str() also receive unsigned type.

static const char *vga_iostate_to_str(unsigned int iostate)

>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
> drop this change

OK,

This is a double blank line.

Originally, I intend to accumulate all tiny fix, commit together.

As they are trivial.

Now, Should I split this patch,

then this patch set will contain two trivial patch ?

>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
> this is OK, it's actually what you are describing in the commit
> log, but...
>
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> ... all the rest needs to go on different patches as it doesn't
> have anything to do with what you describe.

OK,

I will wait a few days for more reviews,

I process them together,   also avoid version grow too fast.

Thanks.

> Andi

-- 
Jingfeng


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06  2:06     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06  2:06 UTC (permalink / raw)
  To: Andi Shyti, Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, David Airlie, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maxime Ripard, loongson-kernel,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Thomas Zimmermann, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 06:16, Andi Shyti wrote:
> Hi Sui,
>
> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
> I think the real reason is not to keep consistent with
> vga_iostate_to_str() but because vga_str_to_iostate() is actually
> only taking "unsigned int *" parameters.

Yes, right.

my expression is not completely correct, I will update it at next version.


I think, we have the same opinion.

Originally, I also want to express the opinion.

Because, it make no sense to  interpret the return value

(VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type.


IO state should be should be donate by a unsigned type.

vga_iostate_to_str() also receive unsigned type.

static const char *vga_iostate_to_str(unsigned int iostate)

>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
> drop this change

OK,

This is a double blank line.

Originally, I intend to accumulate all tiny fix, commit together.

As they are trivial.

Now, Should I split this patch,

then this patch set will contain two trivial patch ?

>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
> this is OK, it's actually what you are describing in the commit
> log, but...
>
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> ... all the rest needs to go on different patches as it doesn't
> have anything to do with what you describe.

OK,

I will wait a few days for more reviews,

I process them together,   also avoid version grow too fast.

Thanks.

> Andi

-- 
Jingfeng


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06  2:06     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06  2:06 UTC (permalink / raw)
  To: Andi Shyti, Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, David Airlie,
	Ville Syrjala, Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs,
	linux-pci, Andrey Grodzovsky, Kevin Tian, Lijo Lazar,
	Daniel Vetter, Bokun Zhang, intel-gfx, Maarten Lankhorst,
	Maxime Ripard, loongson-kernel, Alex Williamson, Abhishek Sahu,
	Jani Nikula, Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Thomas Zimmermann,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 06:16, Andi Shyti wrote:
> Hi Sui,
>
> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
> I think the real reason is not to keep consistent with
> vga_iostate_to_str() but because vga_str_to_iostate() is actually
> only taking "unsigned int *" parameters.

Yes, right.

my expression is not completely correct, I will update it at next version.


I think, we have the same opinion.

Originally, I also want to express the opinion.

Because, it make no sense to  interpret the return value

(VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type.


IO state should be should be donate by a unsigned type.

vga_iostate_to_str() also receive unsigned type.

static const char *vga_iostate_to_str(unsigned int iostate)

>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
> drop this change

OK,

This is a double blank line.

Originally, I intend to accumulate all tiny fix, commit together.

As they are trivial.

Now, Should I split this patch,

then this patch set will contain two trivial patch ?

>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
> this is OK, it's actually what you are describing in the commit
> log, but...
>
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> ... all the rest needs to go on different patches as it doesn't
> have anything to do with what you describe.

OK,

I will wait a few days for more reviews,

I process them together,   also avoid version grow too fast.

Thanks.

> Andi

-- 
Jingfeng


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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06  2:06     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06  2:06 UTC (permalink / raw)
  To: Andi Shyti, Sui Jingfeng
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Ville Syrjala, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 06:16, Andi Shyti wrote:
> Hi Sui,
>
> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
> I think the real reason is not to keep consistent with
> vga_iostate_to_str() but because vga_str_to_iostate() is actually
> only taking "unsigned int *" parameters.

Yes, right.

my expression is not completely correct, I will update it at next version.


I think, we have the same opinion.

Originally, I also want to express the opinion.

Because, it make no sense to  interpret the return value

(VGA_RSRC_LEGACY_IO | VGA_RSRC_LEGACY_MEM) as int type.


IO state should be should be donate by a unsigned type.

vga_iostate_to_str() also receive unsigned type.

static const char *vga_iostate_to_str(unsigned int iostate)

>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
> drop this change

OK,

This is a double blank line.

Originally, I intend to accumulate all tiny fix, commit together.

As they are trivial.

Now, Should I split this patch,

then this patch set will contain two trivial patch ?

>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
> this is OK, it's actually what you are describing in the commit
> log, but...
>
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> ... all the rest needs to go on different patches as it doesn't
> have anything to do with what you describe.

OK,

I will wait a few days for more reviews,

I process them together,   also avoid version grow too fast.

Thanks.

> Andi

-- 
Jingfeng


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-06  2:06     ` Sui Jingfeng
                         ` (2 preceding siblings ...)
  (?)
@ 2023-06-06 10:27       ` Sui Jingfeng
  -1 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06 10:27 UTC (permalink / raw)
  To: Sui Jingfeng, Andi Shyti
  Cc: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Jason Gunthorpe, Kevin Tian,
	Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu, kvm, nouveau,
	intel-gfx, linux-kernel, dri-devel, loongson-kernel, amd-gfx,
	linux-pci

Hi,

On 2023/6/6 10:06, Sui Jingfeng wrote:
> Originally, I also want to express the opinion. 


Originally,  I want to express the same opinion as you told me.

Because vga_iostate_to_str() function is taking unsigned int parameter.

so, I think, using 'unsigned int *' type as the third parameter 
vga_str_to_iostate() function is more suitable.


But this patch is too trivial, so I smash them into one patch.


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 10:27       ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06 10:27 UTC (permalink / raw)
  To: Sui Jingfeng, Andi Shyti
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, linux-pci, Andrey Grodzovsky,
	Kevin Tian, Lijo Lazar, Bokun Zhang, intel-gfx, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Thomas Zimmermann, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 10:06, Sui Jingfeng wrote:
> Originally, I also want to express the opinion. 


Originally,  I want to express the same opinion as you told me.

Because vga_iostate_to_str() function is taking unsigned int parameter.

so, I think, using 'unsigned int *' type as the third parameter 
vga_str_to_iostate() function is more suitable.


But this patch is too trivial, so I smash them into one patch.


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 10:27       ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06 10:27 UTC (permalink / raw)
  To: Sui Jingfeng, Andi Shyti
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, David Airlie, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maxime Ripard, loongson-kernel,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Thomas Zimmermann, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 10:06, Sui Jingfeng wrote:
> Originally, I also want to express the opinion. 


Originally,  I want to express the same opinion as you told me.

Because vga_iostate_to_str() function is taking unsigned int parameter.

so, I think, using 'unsigned int *' type as the third parameter 
vga_str_to_iostate() function is more suitable.


But this patch is too trivial, so I smash them into one patch.


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 10:27       ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06 10:27 UTC (permalink / raw)
  To: Sui Jingfeng, Andi Shyti
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, David Airlie,
	Ville Syrjala, Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs,
	linux-pci, Andrey Grodzovsky, Kevin Tian, Lijo Lazar,
	Daniel Vetter, Bokun Zhang, intel-gfx, Maarten Lankhorst,
	Maxime Ripard, loongson-kernel, Alex Williamson, Abhishek Sahu,
	Jani Nikula, Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Thomas Zimmermann,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 10:06, Sui Jingfeng wrote:
> Originally, I also want to express the opinion. 


Originally,  I want to express the same opinion as you told me.

Because vga_iostate_to_str() function is taking unsigned int parameter.

so, I think, using 'unsigned int *' type as the third parameter 
vga_str_to_iostate() function is more suitable.


But this patch is too trivial, so I smash them into one patch.


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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 10:27       ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-06 10:27 UTC (permalink / raw)
  To: Sui Jingfeng, Andi Shyti
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Ville Syrjala, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/6 10:06, Sui Jingfeng wrote:
> Originally, I also want to express the opinion. 


Originally,  I want to express the same opinion as you told me.

Because vga_iostate_to_str() function is taking unsigned int parameter.

so, I think, using 'unsigned int *' type as the third parameter 
vga_str_to_iostate() function is more suitable.


But this patch is too trivial, so I smash them into one patch.


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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-06 10:27       ` Sui Jingfeng
                           ` (2 preceding siblings ...)
  (?)
@ 2023-06-06 11:00         ` Andi Shyti
  -1 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-06 11:00 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, Andi Shyti, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Sui Jingfeng,
	Thomas Zimmermann, Bokun Zhang, intel-gfx, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Cornelia Huck, Alex Deucher, Christian Konig,
	Hawking Zhang

Hi Sui,

On Tue, Jun 06, 2023 at 06:27:05PM +0800, Sui Jingfeng wrote:
> Hi,
> 
> On 2023/6/6 10:06, Sui Jingfeng wrote:
> > Originally, I also want to express the opinion.
> 
> 
> Originally,  I want to express the same opinion as you told me.
> 
> Because vga_iostate_to_str() function is taking unsigned int parameter.
> 
> so, I think, using 'unsigned int *' type as the third parameter
> vga_str_to_iostate() function is more suitable.
> 
> 
> But this patch is too trivial, so I smash them into one patch.

it does not matter. Please keep patches separated. A trivial
patch can be ignored, however lots of trivial patches in a bigger
series might be appreciated.

Have fun!

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 11:00         ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-06 11:00 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, David Airlie, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Sui Jingfeng,
	Thomas Zimmermann, Bokun Zhang, intel-gfx, Maxime Ripard,
	loongson-kernel, Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Daniel Vetter,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Hi Sui,

On Tue, Jun 06, 2023 at 06:27:05PM +0800, Sui Jingfeng wrote:
> Hi,
> 
> On 2023/6/6 10:06, Sui Jingfeng wrote:
> > Originally, I also want to express the opinion.
> 
> 
> Originally,  I want to express the same opinion as you told me.
> 
> Because vga_iostate_to_str() function is taking unsigned int parameter.
> 
> so, I think, using 'unsigned int *' type as the third parameter
> vga_str_to_iostate() function is more suitable.
> 
> 
> But this patch is too trivial, so I smash them into one patch.

it does not matter. Please keep patches separated. A trivial
patch can be ignored, however lots of trivial patches in a bigger
series might be appreciated.

Have fun!

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 11:00         ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-06 11:00 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, David Airlie,
	Ville Syrjala, Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs,
	Andi Shyti, linux-pci, Andrey Grodzovsky, Kevin Tian, Lijo Lazar,
	Sui Jingfeng, Thomas Zimmermann, Bokun Zhang, intel-gfx,
	Maarten Lankhorst, Maxime Ripard, loongson-kernel,
	Alex Williamson, Abhishek Sahu, Jani Nikula, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Daniel Vetter, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi Sui,

On Tue, Jun 06, 2023 at 06:27:05PM +0800, Sui Jingfeng wrote:
> Hi,
> 
> On 2023/6/6 10:06, Sui Jingfeng wrote:
> > Originally, I also want to express the opinion.
> 
> 
> Originally,  I want to express the same opinion as you told me.
> 
> Because vga_iostate_to_str() function is taking unsigned int parameter.
> 
> so, I think, using 'unsigned int *' type as the third parameter
> vga_str_to_iostate() function is more suitable.
> 
> 
> But this patch is too trivial, so I smash them into one patch.

it does not matter. Please keep patches separated. A trivial
patch can be ignored, however lots of trivial patches in a bigger
series might be appreciated.

Have fun!

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 11:00         ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-06 11:00 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Sui Jingfeng, Andi Shyti, Alex Deucher, Christian Konig,
	Pan Xinhui, David Airlie, Daniel Vetter, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Ben Skeggs,
	Karol Herbst, Lyude Paul, Bjorn Helgaas, Alex Williamson,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Hawking Zhang, Mario Limonciello, Lijo Lazar, YiPeng Chai,
	Andrey Grodzovsky, Somalapuram Amaranath, Bokun Zhang,
	Ville Syrjala, Li Yi, Jason Gunthorpe, Kevin Tian, Cornelia Huck,
	Yishai Hadas, Abhishek Sahu, Yi Liu, kvm, nouveau, intel-gfx,
	linux-kernel, dri-devel, loongson-kernel, amd-gfx, linux-pci

Hi Sui,

On Tue, Jun 06, 2023 at 06:27:05PM +0800, Sui Jingfeng wrote:
> Hi,
> 
> On 2023/6/6 10:06, Sui Jingfeng wrote:
> > Originally, I also want to express the opinion.
> 
> 
> Originally,  I want to express the same opinion as you told me.
> 
> Because vga_iostate_to_str() function is taking unsigned int parameter.
> 
> so, I think, using 'unsigned int *' type as the third parameter
> vga_str_to_iostate() function is more suitable.
> 
> 
> But this patch is too trivial, so I smash them into one patch.

it does not matter. Please keep patches separated. A trivial
patch can be ignored, however lots of trivial patches in a bigger
series might be appreciated.

Have fun!

Andi

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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 11:00         ` Andi Shyti
  0 siblings, 0 replies; 42+ messages in thread
From: Andi Shyti @ 2023-06-06 11:00 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Ville Syrjala, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, Andi Shyti, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Sui Jingfeng,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Daniel Vetter, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Hi Sui,

On Tue, Jun 06, 2023 at 06:27:05PM +0800, Sui Jingfeng wrote:
> Hi,
> 
> On 2023/6/6 10:06, Sui Jingfeng wrote:
> > Originally, I also want to express the opinion.
> 
> 
> Originally,  I want to express the same opinion as you told me.
> 
> Because vga_iostate_to_str() function is taking unsigned int parameter.
> 
> so, I think, using 'unsigned int *' type as the third parameter
> vga_str_to_iostate() function is more suitable.
> 
> 
> But this patch is too trivial, so I smash them into one patch.

it does not matter. Please keep patches separated. A trivial
patch can be ignored, however lots of trivial patches in a bigger
series might be appreciated.

Have fun!

Andi

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-04 20:58 ` Sui Jingfeng
                     ` (2 preceding siblings ...)
  (?)
@ 2023-06-06 19:49   ` Bjorn Helgaas
  -1 siblings, 0 replies; 42+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 19:49 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu,
	kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

Match the subject line style:

  $ git log --oneline drivers/pci/vgaarb.c
  f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
  d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
  4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
  dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
  ...

Subject line should be a summary of the commit log, not just "various
style fixes".  This one needs to say something about
vga_str_to_iostate().

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.
> 
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -
>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

Omit all the comment formatting changes.  They are distractions from the
vga_str_to_iostate() parameter change.

I think this patch should be the single line change to the
vga_str_to_iostate() prototype so it matches the callers.

If you want to do the other comment formatting changes, they're fine,
but they should be all together in a separate patch that clearly
doesn't change the generated code.

Bjorn

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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 19:49   ` Bjorn Helgaas
  0 siblings, 0 replies; 42+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 19:49 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Ville Syrjala,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Match the subject line style:

  $ git log --oneline drivers/pci/vgaarb.c
  f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
  d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
  4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
  dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
  ...

Subject line should be a summary of the commit log, not just "various
style fixes".  This one needs to say something about
vga_str_to_iostate().

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.
> 
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -
>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

Omit all the comment formatting changes.  They are distractions from the
vga_str_to_iostate() parameter change.

I think this patch should be the single line change to the
vga_str_to_iostate() prototype so it matches the callers.

If you want to do the other comment formatting changes, they're fine,
but they should be all together in a separate patch that clearly
doesn't change the generated code.

Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 19:49   ` Bjorn Helgaas
  0 siblings, 0 replies; 42+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 19:49 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Bokun Zhang,
	intel-gfx, Maxime Ripard, loongson-kernel, Alex Williamson,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Thomas Zimmermann,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Match the subject line style:

  $ git log --oneline drivers/pci/vgaarb.c
  f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
  d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
  4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
  dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
  ...

Subject line should be a summary of the commit log, not just "various
style fixes".  This one needs to say something about
vga_str_to_iostate().

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.
> 
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -
>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

Omit all the comment formatting changes.  They are distractions from the
vga_str_to_iostate() parameter change.

I think this patch should be the single line change to the
vga_str_to_iostate() prototype so it matches the callers.

If you want to do the other comment formatting changes, they're fine,
but they should be all together in a separate patch that clearly
doesn't change the generated code.

Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 19:49   ` Bjorn Helgaas
  0 siblings, 0 replies; 42+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 19:49 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, David Airlie,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maxime Ripard, loongson-kernel,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Thomas Zimmermann, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Match the subject line style:

  $ git log --oneline drivers/pci/vgaarb.c
  f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
  d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
  4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
  dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
  ...

Subject line should be a summary of the commit log, not just "various
style fixes".  This one needs to say something about
vga_str_to_iostate().

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.
> 
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -
>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

Omit all the comment formatting changes.  They are distractions from the
vga_str_to_iostate() parameter change.

I think this patch should be the single line change to the
vga_str_to_iostate() prototype so it matches the callers.

If you want to do the other comment formatting changes, they're fine,
but they should be all together in a separate patch that clearly
doesn't change the generated code.

Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-06 19:49   ` Bjorn Helgaas
  0 siblings, 0 replies; 42+ messages in thread
From: Bjorn Helgaas @ 2023-06-06 19:49 UTC (permalink / raw)
  To: Sui Jingfeng
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, Sui Jingfeng,
	David Airlie, Ville Syrjala, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, linux-pci, Andrey Grodzovsky,
	Kevin Tian, Lijo Lazar, Daniel Vetter, Bokun Zhang, intel-gfx,
	Maarten Lankhorst, Maxime Ripard, loongson-kernel,
	Alex Williamson, Abhishek Sahu, Jani Nikula, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Thomas Zimmermann, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Match the subject line style:

  $ git log --oneline drivers/pci/vgaarb.c
  f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
  d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
  4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
  dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
  ...

Subject line should be a summary of the commit log, not just "various
style fixes".  This one needs to say something about
vga_str_to_iostate().

On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
> From: Sui Jingfeng <suijingfeng@loongson.cn>
> 
> To keep consistent with vga_iostate_to_str() function, the third argument
> of vga_str_to_iostate() function should be 'unsigned int *'.
> 
> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
> ---
>  drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>  include/linux/vgaarb.h |  8 +++-----
>  2 files changed, 18 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
> index 5a696078b382..e40e6e5e5f03 100644
> --- a/drivers/pci/vgaarb.c
> +++ b/drivers/pci/vgaarb.c
> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>  static DEFINE_SPINLOCK(vga_lock);
>  static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>  
> -
>  static const char *vga_iostate_to_str(unsigned int iostate)
>  {
>  	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>  	return "none";
>  }
>  
> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>  {
> -	/* we could in theory hand out locks on IO and mem
> -	 * separately to userspace but it can cause deadlocks */
> +	/*
> +	 * we could in theory hand out locks on IO and mem
> +	 * separately to userspace but it can cause deadlocks
> +	 */

Omit all the comment formatting changes.  They are distractions from the
vga_str_to_iostate() parameter change.

I think this patch should be the single line change to the
vga_str_to_iostate() prototype so it matches the callers.

If you want to do the other comment formatting changes, they're fine,
but they should be all together in a separate patch that clearly
doesn't change the generated code.

Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
  2023-06-06 19:49   ` [Nouveau] " Bjorn Helgaas
                       ` (2 preceding siblings ...)
  (?)
@ 2023-06-07  6:16     ` Sui Jingfeng
  -1 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-07  6:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu,
	kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

Hi,

On 2023/6/7 03:49, Bjorn Helgaas wrote:
> Match the subject line style:
>
>    $ git log --oneline drivers/pci/vgaarb.c
>    f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
>    d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
>    4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
>    dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
>    ...
>
> Subject line should be a summary of the commit log, not just "various
> style fixes".  This one needs to say something about
> vga_str_to_iostate().

Ok, thanks for the educating .

> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
>>
>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> Omit all the comment formatting changes.  They are distractions from the
> vga_str_to_iostate() parameter change.
>
> I think this patch should be the single line change to the
> vga_str_to_iostate() prototype so it matches the callers.
>
> If you want to do the other comment formatting changes, they're fine,
> but they should be all together in a separate patch that clearly
> doesn't change the generated code.

Ok, no problem.

Will be improved at next version.

> Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-07  6:16     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-07  6:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Yi Liu, kvm,
	amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Bokun Zhang,
	intel-gfx, Maxime Ripard, loongson-kernel, Alex Williamson,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin,
	Yishai Hadas, Li Yi, Pan Xinhui, linux-kernel, Thomas Zimmermann,
	Cornelia Huck, Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/7 03:49, Bjorn Helgaas wrote:
> Match the subject line style:
>
>    $ git log --oneline drivers/pci/vgaarb.c
>    f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
>    d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
>    4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
>    dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
>    ...
>
> Subject line should be a summary of the commit log, not just "various
> style fixes".  This one needs to say something about
> vga_str_to_iostate().

Ok, thanks for the educating .

> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
>>
>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> Omit all the comment formatting changes.  They are distractions from the
> vga_str_to_iostate() parameter change.
>
> I think this patch should be the single line change to the
> vga_str_to_iostate() prototype so it matches the callers.
>
> If you want to do the other comment formatting changes, they're fine,
> but they should be all together in a separate patch that clearly
> doesn't change the generated code.

Ok, no problem.

Will be improved at next version.

> Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-07  6:16     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-07  6:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, David Airlie,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maxime Ripard, loongson-kernel,
	Abhishek Sahu, Rodrigo Vivi, Bjorn Helgaas, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Thomas Zimmermann, Cornelia Huck,
	Alex Deucher, Christian Konig, Hawking Zhang

Hi,

On 2023/6/7 03:49, Bjorn Helgaas wrote:
> Match the subject line style:
>
>    $ git log --oneline drivers/pci/vgaarb.c
>    f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
>    d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
>    4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
>    dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
>    ...
>
> Subject line should be a summary of the commit log, not just "various
> style fixes".  This one needs to say something about
> vga_str_to_iostate().

Ok, thanks for the educating .

> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
>>
>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> Omit all the comment formatting changes.  They are distractions from the
> vga_str_to_iostate() parameter change.
>
> I think this patch should be the single line change to the
> vga_str_to_iostate() prototype so it matches the callers.
>
> If you want to do the other comment formatting changes, they're fine,
> but they should be all together in a separate patch that clearly
> doesn't change the generated code.

Ok, no problem.

Will be improved at next version.

> Bjorn

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

* Re: [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-07  6:16     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-07  6:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Somalapuram Amaranath, Karol Herbst, nouveau, Joonas Lahtinen,
	dri-devel, YiPeng Chai, Mario Limonciello, Sui Jingfeng,
	David Airlie, Ville Syrjala, Yi Liu, kvm, amd-gfx,
	Jason Gunthorpe, Ben Skeggs, linux-pci, Andrey Grodzovsky,
	Kevin Tian, Lijo Lazar, Daniel Vetter, Bokun Zhang, intel-gfx,
	Maarten Lankhorst, Maxime Ripard, loongson-kernel,
	Alex Williamson, Abhishek Sahu, Jani Nikula, Rodrigo Vivi,
	Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi, Pan Xinhui,
	linux-kernel, Thomas Zimmermann, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/7 03:49, Bjorn Helgaas wrote:
> Match the subject line style:
>
>    $ git log --oneline drivers/pci/vgaarb.c
>    f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
>    d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
>    4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
>    dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
>    ...
>
> Subject line should be a summary of the commit log, not just "various
> style fixes".  This one needs to say something about
> vga_str_to_iostate().

Ok, thanks for the educating .

> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
>>
>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> Omit all the comment formatting changes.  They are distractions from the
> vga_str_to_iostate() parameter change.
>
> I think this patch should be the single line change to the
> vga_str_to_iostate() prototype so it matches the callers.
>
> If you want to do the other comment formatting changes, they're fine,
> but they should be all together in a separate patch that clearly
> doesn't change the generated code.

Ok, no problem.

Will be improved at next version.

> Bjorn

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

* Re: [Nouveau] [Intel-gfx] [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-07  6:16     ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-07  6:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Somalapuram Amaranath, nouveau, Joonas Lahtinen, dri-devel,
	YiPeng Chai, Mario Limonciello, Sui Jingfeng, Ville Syrjala,
	Yi Liu, kvm, amd-gfx, Jason Gunthorpe, Ben Skeggs, linux-pci,
	Andrey Grodzovsky, Kevin Tian, Lijo Lazar, Daniel Vetter,
	Bokun Zhang, intel-gfx, Maarten Lankhorst, Maxime Ripard,
	loongson-kernel, Alex Williamson, Abhishek Sahu, Jani Nikula,
	Rodrigo Vivi, Bjorn Helgaas, Tvrtko Ursulin, Yishai Hadas, Li Yi,
	Pan Xinhui, linux-kernel, Cornelia Huck, Alex Deucher,
	Christian Konig, Hawking Zhang

Hi,

On 2023/6/7 03:49, Bjorn Helgaas wrote:
> Match the subject line style:
>
>    $ git log --oneline drivers/pci/vgaarb.c
>    f321c35feaee PCI/VGA: Replace full MIT license text with SPDX identifier
>    d5109fe4d1ec PCI/VGA: Use unsigned format string to print lock counts
>    4e6c91847a7f PCI/VGA: Log bridge control messages when adding devices
>    dc593fd48abb PCI/VGA: Remove empty vga_arb_device_card_gone()
>    ...
>
> Subject line should be a summary of the commit log, not just "various
> style fixes".  This one needs to say something about
> vga_str_to_iostate().

Ok, thanks for the educating .

> On Mon, Jun 05, 2023 at 04:58:30AM +0800, Sui Jingfeng wrote:
>> From: Sui Jingfeng <suijingfeng@loongson.cn>
>>
>> To keep consistent with vga_iostate_to_str() function, the third argument
>> of vga_str_to_iostate() function should be 'unsigned int *'.
>>
>> Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
>> ---
>>   drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
>>   include/linux/vgaarb.h |  8 +++-----
>>   2 files changed, 18 insertions(+), 19 deletions(-)
>>
>> diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
>> index 5a696078b382..e40e6e5e5f03 100644
>> --- a/drivers/pci/vgaarb.c
>> +++ b/drivers/pci/vgaarb.c
>> @@ -61,7 +61,6 @@ static bool vga_arbiter_used;
>>   static DEFINE_SPINLOCK(vga_lock);
>>   static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
>>   
>> -
>>   static const char *vga_iostate_to_str(unsigned int iostate)
>>   {
>>   	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
>> @@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
>>   	return "none";
>>   }
>>   
>> -static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
>> +static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
>>   {
>> -	/* we could in theory hand out locks on IO and mem
>> -	 * separately to userspace but it can cause deadlocks */
>> +	/*
>> +	 * we could in theory hand out locks on IO and mem
>> +	 * separately to userspace but it can cause deadlocks
>> +	 */
> Omit all the comment formatting changes.  They are distractions from the
> vga_str_to_iostate() parameter change.
>
> I think this patch should be the single line change to the
> vga_str_to_iostate() prototype so it matches the callers.
>
> If you want to do the other comment formatting changes, they're fine,
> but they should be all together in a separate patch that clearly
> doesn't change the generated code.

Ok, no problem.

Will be improved at next version.

> Bjorn

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

* [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:55 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:55 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: amd-gfx, dri-devel, linux-kernel, intel-gfx, nouveau, linux-pci,
	kvm, loongson-kernel

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

* [PATCH v2 1/2] vgaarb: various coding style and comments fix
@ 2023-06-04 20:55 ` Sui Jingfeng
  0 siblings, 0 replies; 42+ messages in thread
From: Sui Jingfeng @ 2023-06-04 20:55 UTC (permalink / raw)
  To: Alex Deucher, Christian Konig, Pan Xinhui, David Airlie,
	Daniel Vetter, Jani Nikula, Joonas Lahtinen, Rodrigo Vivi,
	Tvrtko Ursulin, Ben Skeggs, Karol Herbst, Lyude Paul,
	Bjorn Helgaas, Alex Williamson, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, Hawking Zhang, Mario Limonciello, Lijo Lazar,
	YiPeng Chai, Andrey Grodzovsky, Somalapuram Amaranath,
	Bokun Zhang, Ville Syrjala, Li Yi, Sui Jingfeng, Jason Gunthorpe,
	Kevin Tian, Cornelia Huck, Yishai Hadas, Abhishek Sahu, Yi Liu
  Cc: kvm, nouveau, intel-gfx, linux-kernel, dri-devel,
	loongson-kernel, amd-gfx, linux-pci

To keep consistent with vga_iostate_to_str() function, the third argument
of vga_str_to_iostate() function should be 'unsigned int *'.

Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn>
---
 drivers/pci/vgaarb.c   | 29 +++++++++++++++--------------
 include/linux/vgaarb.h |  8 +++-----
 2 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/pci/vgaarb.c b/drivers/pci/vgaarb.c
index 5a696078b382..e40e6e5e5f03 100644
--- a/drivers/pci/vgaarb.c
+++ b/drivers/pci/vgaarb.c
@@ -61,7 +61,6 @@ static bool vga_arbiter_used;
 static DEFINE_SPINLOCK(vga_lock);
 static DECLARE_WAIT_QUEUE_HEAD(vga_wait_queue);
 
-
 static const char *vga_iostate_to_str(unsigned int iostate)
 {
 	/* Ignore VGA_RSRC_IO and VGA_RSRC_MEM */
@@ -77,10 +76,12 @@ static const char *vga_iostate_to_str(unsigned int iostate)
 	return "none";
 }
 
-static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
+static int vga_str_to_iostate(char *buf, int str_size, unsigned int *io_state)
 {
-	/* we could in theory hand out locks on IO and mem
-	 * separately to userspace but it can cause deadlocks */
+	/*
+	 * we could in theory hand out locks on IO and mem
+	 * separately to userspace but it can cause deadlocks
+	 */
 	if (strncmp(buf, "none", 4) == 0) {
 		*io_state = VGA_RSRC_NONE;
 		return 1;
@@ -99,7 +100,7 @@ static int vga_str_to_iostate(char *buf, int str_size, int *io_state)
 	return 1;
 }
 
-/* this is only used a cookie - it should not be dereferenced */
+/* This is only used as cookie, it should not be dereferenced */
 static struct pci_dev *vga_default;
 
 /* Find somebody in our list */
@@ -194,13 +195,15 @@ int vga_remove_vgacon(struct pci_dev *pdev)
 EXPORT_SYMBOL(vga_remove_vgacon);
 
 /* If we don't ever use VGA arb we should avoid
-   turning off anything anywhere due to old X servers getting
-   confused about the boot device not being VGA */
+ * turning off anything anywhere due to old X servers getting
+ * confused about the boot device not being VGA
+ */
 static void vga_check_first_use(void)
 {
 	/* we should inform all GPUs in the system that
 	 * VGA arb has occurred and to try and disable resources
-	 * if they can */
+	 * if they can
+	 */
 	if (!vga_arbiter_used) {
 		vga_arbiter_used = true;
 		vga_arbiter_notify_clients();
@@ -865,8 +868,7 @@ static bool vga_arbiter_del_pci_device(struct pci_dev *pdev)
 }
 
 /* this is called with the lock */
-static inline void vga_update_device_decodes(struct vga_device *vgadev,
-					     int new_decodes)
+static void vga_update_device_decodes(struct vga_device *vgadev, int new_decodes)
 {
 	struct device *dev = &vgadev->pdev->dev;
 	int old_decodes, decodes_removed, decodes_unlocked;
@@ -956,9 +958,9 @@ EXPORT_SYMBOL(vga_set_legacy_decoding);
  * @set_decode callback: If a client can disable its GPU VGA resource, it
  * will get a callback from this to set the encode/decode state.
  *
- * Rationale: we cannot disable VGA decode resources unconditionally some single
- * GPU laptops seem to require ACPI or BIOS access to the VGA registers to
- * control things like backlights etc.  Hopefully newer multi-GPU laptops do
+ * Rationale: we cannot disable VGA decode resources unconditionally, some
+ * single GPU laptops seem to require ACPI or BIOS access to the VGA registers
+ * to control things like backlights etc. Hopefully newer multi-GPU laptops do
  * something saner, and desktops won't have any special ACPI for this. The
  * driver will get a callback when VGA arbitration is first used by userspace
  * since some older X servers have issues.
@@ -988,7 +990,6 @@ int vga_client_register(struct pci_dev *pdev,
 bail:
 	spin_unlock_irqrestore(&vga_lock, flags);
 	return ret;
-
 }
 EXPORT_SYMBOL(vga_client_register);
 
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index b4b9137f9792..d36225c582ee 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -23,9 +23,7 @@
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS
- * IN THE SOFTWARE.
- *
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifndef LINUX_VGA_H
@@ -96,7 +94,7 @@ static inline int vga_client_register(struct pci_dev *pdev,
 static inline int vga_get_interruptible(struct pci_dev *pdev,
 					unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 1);
+	return vga_get(pdev, rsrc, 1);
 }
 
 /**
@@ -111,7 +109,7 @@ static inline int vga_get_interruptible(struct pci_dev *pdev,
 static inline int vga_get_uninterruptible(struct pci_dev *pdev,
 					  unsigned int rsrc)
 {
-       return vga_get(pdev, rsrc, 0);
+	return vga_get(pdev, rsrc, 0);
 }
 
 static inline void vga_client_unregister(struct pci_dev *pdev)
-- 
2.25.1


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

end of thread, other threads:[~2023-06-20 18:21 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-04 20:58 [PATCH v2 1/2] vgaarb: various coding style and comments fix Sui Jingfeng
2023-06-04 20:58 ` [Nouveau] " Sui Jingfeng
2023-06-04 20:58 ` [Intel-gfx] " Sui Jingfeng
2023-06-04 20:58 ` Sui Jingfeng
2023-06-04 20:58 ` [PATCH v2 2/2] vgaarb: introduce is_boot_device callback function to vga_client_register Sui Jingfeng
2023-06-04 20:58   ` [Nouveau] " Sui Jingfeng
2023-06-04 20:58   ` [Intel-gfx] " Sui Jingfeng
2023-06-04 20:58   ` Sui Jingfeng
2023-06-04 21:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/2] vgaarb: various coding style and comments fix Patchwork
2023-06-05 22:16 ` [Intel-gfx] [PATCH v2 1/2] " Andi Shyti
2023-06-05 22:16   ` [Nouveau] " Andi Shyti
2023-06-05 22:16   ` Andi Shyti
2023-06-05 22:16   ` Andi Shyti
2023-06-05 22:16   ` Andi Shyti
2023-06-06  2:06   ` Sui Jingfeng
2023-06-06  2:06     ` [Nouveau] " Sui Jingfeng
2023-06-06  2:06     ` Sui Jingfeng
2023-06-06  2:06     ` Sui Jingfeng
2023-06-06  2:06     ` Sui Jingfeng
2023-06-06 10:27     ` Sui Jingfeng
2023-06-06 10:27       ` [Nouveau] " Sui Jingfeng
2023-06-06 10:27       ` Sui Jingfeng
2023-06-06 10:27       ` Sui Jingfeng
2023-06-06 10:27       ` Sui Jingfeng
2023-06-06 11:00       ` Andi Shyti
2023-06-06 11:00         ` [Nouveau] " Andi Shyti
2023-06-06 11:00         ` Andi Shyti
2023-06-06 11:00         ` Andi Shyti
2023-06-06 11:00         ` Andi Shyti
2023-06-06  1:05 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [v2,1/2] " Patchwork
2023-06-06 19:49 ` [Intel-gfx] [PATCH v2 1/2] " Bjorn Helgaas
2023-06-06 19:49   ` Bjorn Helgaas
2023-06-06 19:49   ` Bjorn Helgaas
2023-06-06 19:49   ` Bjorn Helgaas
2023-06-06 19:49   ` [Nouveau] " Bjorn Helgaas
2023-06-07  6:16   ` Sui Jingfeng
2023-06-07  6:16     ` [Nouveau] " Sui Jingfeng
2023-06-07  6:16     ` Sui Jingfeng
2023-06-07  6:16     ` Sui Jingfeng
2023-06-07  6:16     ` Sui Jingfeng
  -- strict thread matches above, loose matches on Subject: below --
2023-06-04 20:55 Sui Jingfeng
2023-06-04 20:55 ` Sui Jingfeng

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.