From: bugzilla-daemon-CC+yJ3UmIYqDUpFQwHEjaQ@public.gmane.org Subject: [Bug 86539] [NVAC] Trying to register nv_backlight after NV96 did it Date: Mon, 29 Feb 2016 07:39:04 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1552705064==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "Nouveau" To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: nouveau.vger.kernel.org --===============1552705064== Content-Type: multipart/alternative; boundary="14567315450.0daCEaA2.8968"; charset="UTF-8" --14567315450.0daCEaA2.8968 Date: Mon, 29 Feb 2016 07:39:04 +0000 MIME-Version: 1.0 Content-Type: text/plain https://bugs.freedesktop.org/show_bug.cgi?id=86539 --- Comment #11 from Hans de Goede --- Hi Pierre, Thanks for working on this. I'm not sure what the nbs suffix stands for, maybe rename it to bl_interface_nr ? Chances are that nv50_backlight_init() may run twice at the same time if 2 cards are being probed simultaneously. So I would make bl_interface_nr an atomic_t and use: int nr = atomic_inc_return(&bl_interface_nr) - 1; to increment it and get the _NEW_ value. Since this gives you the new value, you should substract 1 as is done above. Regards, Hans -- You are receiving this mail because: You are the assignee for the bug. --14567315450.0daCEaA2.8968 Date: Mon, 29 Feb 2016 07:39:05 +0000 MIME-Version: 1.0 Content-Type: text/html

Comment # 11 on bug 86539 from
Hi Pierre,

Thanks for working on this. I'm not sure what the nbs suffix stands for, maybe
rename it to
bl_interface_nr ?

Chances are that nv50_backlight_init() may run twice at the same time if 2
cards are being probed simultaneously. So I would make bl_interface_nr an
atomic_t and use:

int nr = atomic_inc_return(&bl_interface_nr) - 1;

to increment it and get the _NEW_ value. Since this gives you the new value,
you should substract 1 as is done above.

Regards,

Hans


You are receiving this mail because:
  • You are the assignee for the bug.
--14567315450.0daCEaA2.8968-- --===============1552705064== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KTm91dmVhdSBt YWlsaW5nIGxpc3QKTm91dmVhdUBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9ub3V2ZWF1Cg== --===============1552705064==--