Skip to contentSkip to conversation

dgnc: Don't save boards in memory that have failed to initialize

PATCH In review Giedrius Statkevičius 4 participants 11 messages Mar 9, 2015 – Mar 16, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dgnc: Don't save boards in memory that have failed to initialize

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

 drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
 drivers/staging/dgnc/dgnc_driver.h |  3 +--
 drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
 drivers/staging/dgnc/dgnc_tty.c    |  8 --------
 4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +2 -18
index fa1ee79..075727d 100644
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);
 
 	if (!brd)
 		return -ENOMEM;
@@ -574,17 +573,12 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	if (rc < 0) {
 		dgnc_tty_uninit(brd);
 		pr_err(DRVSTR ": Can't register tty devices (%d)\n", rc);
-		brd->state = BOARD_FAILED;
-		brd->dpastatus = BD_NOFEP;
 		goto failed;
 	}
 
 	rc = dgnc_finalize_board_init(brd);
 	if (rc < 0) {
 		pr_err(DRVSTR ": Can't finalize board init (%d)\n", rc);
-		brd->state = BOARD_FAILED;
-		brd->dpastatus = BD_NOFEP;
-
 		goto failed;
 	}
 
@@ -592,9 +586,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	if (rc < 0) {
 		dgnc_tty_uninit(brd);
 		pr_err(DRVSTR ": Can't init tty devices (%d)\n", rc);
-		brd->state = BOARD_FAILED;
-		brd->dpastatus = BD_NOFEP;
-
 		goto failed;
 	}
 
@@ -624,6 +615,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL);
 
 	wake_up_interruptible(&brd->state_wait);
+	dgnc_Board[dgnc_NumBoards] = brd;
 
 	return 0;
 
@@ -648,8 +640,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
 		if (rc) {
 			dev_err(&brd->pdev->dev,
 				"Failed to hook IRQ %d\n", brd->irq);
-			brd->state = BOARD_FAILED;
-			brd->dpastatus = BD_NOFEP;
 			rc = -ENODEV;
 		}
 	}
@@ -708,12 +698,6 @@ static void dgnc_poll_handler(ulong dummy)
 
 		spin_lock_irqsave(&brd->bd_lock, flags);
 
-		/* If board is in a failed state, don't bother scheduling a tasklet */
-		if (brd->state == BOARD_FAILED) {
-			spin_unlock_irqrestore(&brd->bd_lock, flags);
-			continue;
-		}
-
 		/* Schedule a poll helper task */
 		tasklet_schedule(&brd->helper_tasklet);
 
drivers/staging/dgnc/dgnc_driver.h +1 -2
index 734bdc2..9f0d97b 100644
@@ -107,8 +107,7 @@ enum {
  * All the possible states the board can be while booting up.
  */
 enum {
-	BOARD_FAILED = 0,
-	BOARD_FOUND,
+	BOARD_FOUND = 0,
 	BOARD_READY
 };
 
drivers/staging/dgnc/dgnc_mgmt.c +1 -4
index 5544a8e..8c3a1bf 100644
@@ -168,10 +168,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		di.info_ioport = 0;
 		di.info_physaddr = (ulong) dgnc_Board[brd]->membase;
 		di.info_physsize = (ulong) dgnc_Board[brd]->membase - dgnc_Board[brd]->membase_end;
-		if (dgnc_Board[brd]->state != BOARD_FAILED)
-			di.info_nports = dgnc_Board[brd]->nasync;
-		else
-			di.info_nports = 0;
+		di.info_nports = dgnc_Board[brd]->nasync;
 
 		spin_unlock_irqrestore(&dgnc_Board[brd]->bd_lock, flags);
 
drivers/staging/dgnc/dgnc_tty.c +0 -8
index 8179342..570eb7e 100644
@@ -1253,14 +1253,6 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
 
 		sleep_on_un_flags = 0;
 
-		/*
-		 * If board has failed somehow during our sleep, bail with error.
-		 */
-		if (ch->ch_bd->state == BOARD_FAILED) {
-			retval = -ENXIO;
-			break;
-		}
-
 		/* If tty was hung up, break out of loop and set error. */
 		if (tty_hung_up_p(file)) {
 			retval = -EAGAIN;
Signature · 1 line
2.3.2
#1 lore raw
Quoted 10 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

Great! Very thourough. Thanks. :)

regards,
dan carpenter

maintainer
#2 lore raw
In reply to Giedrius Statkevičius
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

 drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
 drivers/staging/dgnc/dgnc_driver.h |  3 +--
 drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
 drivers/staging/dgnc/dgnc_tty.c    |  8 --------
 4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

greg k-h

#3 lore raw
Quoted 1 line · Greg KH

I really want to see this whole "static list of boards/cards" go away.

Yes, but I feel like this is a step in that direction. It just deletes dead code, it doesn't add anything.

regards,
dan carpenter

#4 lore raw
In reply to Greg KH
Quoted 42 lines · Greg KH
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

 drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
 drivers/staging/dgnc/dgnc_driver.h |  3 +--
 drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
 drivers/staging/dgnc/dgnc_tty.c    |  8 --------
 4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

Quoted 9 lines

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

greg k-h

I can try :) But my main concern is the lack of dgnc driver maintainers activity and that I don't own the hardware this driver is written for as it's quite expensive (cheapest cards I've found start at 300$~) and I can't afford it ATM. But I guess if I keep the patches small and logical everything will be okay.

Signature · 2 lines
Thanks,
Giedrius
#5 lore raw
Quoted 50 lines · Giedrius Statkevičius
Quoted 49 lines · Greg KH
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

  drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
  drivers/staging/dgnc/dgnc_driver.h |  3 +--
  drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
  drivers/staging/dgnc/dgnc_tty.c    |  8 --------
  4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
  	unsigned long flags;
 
  	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

Quoted 9 lines
Quoted 2 lines

greg k-h

I can try :) But my main concern is the lack of dgnc driver maintainers activity and that I don't own the hardware this driver is written for as it's quite expensive (cheapest cards I've found start at 300$~) and I can't afford it ATM. But I guess if I keep the patches small and logical everything will be okay.

I am on the maintainers list and actually have hardware. I have just been so swamped the last few months that I haven't been able to do ANYTHING here. Even work on the dgap driver that I was working on, I just haven't had the time. I can tell you that the dgnc driver does NOT work at all and hasn't worked since it was introduced into staging by Greg.

Greg, while I'm here, how can we get Digi firmware into the kernel firmware tree? The dgap card is useless without it and I suspect the dgnc is as well.

Regards
mark

maintainer
#6 lore raw
Quoted 61 lines · Mark Hounschell
Quoted 50 lines · Giedrius Statkevičius
Quoted 49 lines · Greg KH
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

 drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
 drivers/staging/dgnc/dgnc_driver.h |  3 +--
 drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
 drivers/staging/dgnc/dgnc_tty.c    |  8 --------
 4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

Quoted 9 lines
Quoted 2 lines

greg k-h

I can try :) But my main concern is the lack of dgnc driver maintainers activity and that I don't own the hardware this driver is written for as it's quite expensive (cheapest cards I've found start at 300$~) and I can't afford it ATM. But I guess if I keep the patches small and logical everything will be okay.

Quoted 5 lines

I am on the maintainers list and actually have hardware. I have just been so swamped the last few months that I haven't been able to do ANYTHING here. Even work on the dgap driver that I was working on, I just haven't had the time. I can tell you that the dgnc driver does NOT work at all and hasn't worked since it was introduced into staging by Greg.

Really? It's always been broken? Why don't we just delete the thing?

Quoted 2 lines

Greg, while I'm here, how can we get Digi firmware into the kernel firmware tree? The dgap card is useless without it and I suspect the dgnc is as well.

Submit a patch to the linux-firmware git tree with the firmware in it.

thanks,

greg k-h

#7 lore raw
Quoted 62 lines · Greg KH
Quoted 61 lines · Mark Hounschell
Quoted 59 lines · Giedrius Statkevičius
Quoted 42 lines · Greg KH
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

  drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
  drivers/staging/dgnc/dgnc_driver.h |  3 +--
  drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
  drivers/staging/dgnc/dgnc_tty.c    |  8 --------
  4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
  	unsigned long flags;
 
  	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

Quoted 9 lines

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

greg k-h

I can try :) But my main concern is the lack of dgnc driver maintainers activity and that I don't own the hardware this driver is written for as it's quite expensive (cheapest cards I've found start at 300$~) and I can't afford it ATM. But I guess if I keep the patches small and logical everything will be okay.

Quoted 8 lines
Quoted 5 lines

I am on the maintainers list and actually have hardware. I have just been so swamped the last few months that I haven't been able to do ANYTHING here. Even work on the dgap driver that I was working on, I just haven't had the time. I can tell you that the dgnc driver does NOT work at all and hasn't worked since it was introduced into staging by Greg.

Really? It's always been broken? Why don't we just delete the thing?

Well, broken might not be the best word. I should have just said, doesn't work for me.
It did work on a 3.4 kernel when I provided it to you. I have spent no time as to why but will take a look on Monday.

Quoted 5 lines
Quoted 2 lines

Greg, while I'm here, how can we get Digi firmware into the kernel firmware tree? The dgap card is useless without it and I suspect the dgnc is as well.

Submit a patch to the linux-firmware git tree with the firmware in it.

I don't know if the binary blobs are GPL compatable?

Regards
Mark

maintainer
#8 lore raw
Quoted 7 lines · Mark Hounschell
Quoted 5 lines
Quoted 2 lines

Greg, while I'm here, how can we get Digi firmware into the kernel firmware tree? The dgap card is useless without it and I suspect the dgnc is as well.

Submit a patch to the linux-firmware git tree with the firmware in it.

I don't know if the binary blobs are GPL compatable?

Look at the hundreds of different licenses in the linux-firmware tree, they are all different for different reasons / companies. Use whatever license Digi uses for their firmware, it might already be part of the tree.

hope this helps,

greg k-h

#9 lore raw
In reply to Mark Hounschell
Quoted 84 lines · Mark Hounschell
Quoted 83 lines · Greg KH
Quoted 81 lines · Mark Hounschell
Quoted 62 lines · Giedrius Statkevičius
Quoted 54 lines · Greg KH
Quoted 30 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put
it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant
before this patch.

Signed-off-by: Giedrius Statkevičius <[email protected]>
---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do
in the first version

  drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
  drivers/staging/dgnc/dgnc_driver.h |  3 +--
  drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
  drivers/staging/dgnc/dgnc_tty.c    |  8 --------
  4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev · line 405

Quoted 7 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev
 *pdev, int id)
      unsigned long flags;
 
      /* get the board structure and prep it */
-    dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-    brd = dgnc_Board[dgnc_NumBoards];
+    brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static
array mess.

So could you do that instead? I don't want to take patches around this
whole "board state" mess anymore, as it should all not be needed at all.

Quoted 6 lines

If you need pointers on what needs to be done here, just let me know.

thanks,

greg k-h

Quoted 8 lines

I can try :) But my main concern is the lack of dgnc driver maintainers activity and that I don't own the hardware this driver is written for as
it's quite expensive (cheapest cards I've found start at 300$~) and I can't afford it ATM. But I guess if I keep the patches small and logical
everything will be okay.

I am on the maintainers list and actually have hardware. I have just been so
swamped the last few months that I haven't been able to do ANYTHING here.
Even work on the dgap driver that I was working on, I just haven't had the
time. I can tell you that the dgnc driver does NOT work at all and hasn't
worked since it was introduced into staging by Greg.

Quoted 8 lines
Quoted 2 lines

Really? It's always been broken? Why don't we just delete the thing?

Well, broken might not be the best word. I should have just said, doesn't work for me.
It did work on a 3.4 kernel when I provided it to you. I have spent no time as to why but will take a look on Monday.

The driver actually does work. It didn't work for me because the device entries were not as they used to be. So if you want to make a change you think needs testing, I can test it. I only have a single card 8 port though.

Regards
Mark

#10 lore raw
In reply to Greg KH

Hi Greg,

Quoted 42 lines · Greg KH
Quoted 25 lines · Giedrius Statkevičius

Remove BOARD_FAILED and don't save dgnc_boards which failed to initialize.

Assign the result of kzalloc() to brd in dgnc_found_board() and only put it in the dgnc_Board[] if it successfully initializes. Also, remove BOARD_FAILED enum and all ifs that check for it. Finally, remove one final place where state was set to BOARD_FAILED which was even redundant before this patch.

---
v2: Remove "brd = dgnc_Board[dgnc_NumBoards];" line which I forgot to do in the first version

 drivers/staging/dgnc/dgnc_driver.c | 20 ++------------------
 drivers/staging/dgnc/dgnc_driver.h |  3 +--
 drivers/staging/dgnc/dgnc_mgmt.c   |  5 +----
 drivers/staging/dgnc/dgnc_tty.c    |  8 --------
 4 files changed, 4 insertions(+), 32 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index fa1ee79..075727d 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_found_board(struct pci_dev *pdev, int id) · line 404

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +1 -2
@@ -401,8 +401,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
 	unsigned long flags;
 
 	/* get the board structure and prep it */
-	dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL);
-	brd = dgnc_Board[dgnc_NumBoards];
+	brd = kzalloc(sizeof(*brd), GFP_KERNEL);

You've done a great job here, but...

Yeah, sorry...

I really want to see this whole "static list of boards/cards" go away. There should not be any need for that in any in-kernel driver. Your patch here is a sign that things are really wrong with this whole static array mess.

Quoted 9 lines

So could you do that instead? I don't want to take patches around this whole "board state" mess anymore, as it should all not be needed at all.

If you need pointers on what needs to be done here, just let me know.

thanks,

greg k-h

Hmm,
The only thing I thought of that is relevant is that the one big file/ioctl that handles getting info of any board could be split into many and each could return information about that own board (DIGI_GET_NI_INFO => get non-intelligent state info and DIGI_GETBD => get board info). The last ioctl that returns number of boards could be deduced from special files (of each board) in the system.

I don't know how we can avoid a list of boards because we create sysfs files for each board, register each board with tty core and poll all the boards each 20ms.

Could you elaborate more, give some more info?

Signature · 2 lines
Thanks,
Giedrius