Skip to contentSkip to conversation

ata:Remove no longer valid FIXME comment in pata_ninja32.c for the function,ninja32_init_one

PATCH Bartlomiej Zolnierkiewicz 1 participant 3 messages Feb 5, 2015 3 messages not in the archive libata

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Quoted 21 lines · Nicholas Krause

Removes the no longer valid fix me comment in the function, ninja32_init_one for questioning if we are required to remove the activated device at the end of this function by calling the function, ata_host_activate to activate the device passed by the caller of the function ninja_init_one. This comment is no longer needed as we need to deallocate the memory used to store this device's information when the device is no longer in use by the system in order to avoid leaking memory. Due to this the driver in the file,ninja32_init_one has the function,ata_pci_remove_one to release the memory allocated in it's init function and therefore this comment can now be removed due to use correctly freeing the memory allocated from the driver's init function,ninja32_init_one.

---
 drivers/ata/pata_ninja32.c | 1 -
 1 file changed, 1 deletion(-)
drivers/ata/pata_ninja32.c +0 -0
index efb272d..47b30d3 100644

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 150

Quoted 4 lines
drivers/ata/pata_ninja32.c +0 -1
@@ -147,7 +147,6 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
 	ap->pflags = ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
 
 	ninja32_program(base);
-	/* FIXME: Should we disable them at remove ? */

After looking at the driver history I think that the comment is about ninja32_program() enabling interrupt lines (which don't get disabled when the host controller is detached from the driver) not about the cleanup done during ata_pci_remove_one(). Alan, is this correct?

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 152

Quoted 3 lines
drivers/ata/pata_ninja32.c +0 -0
 	return ata_host_activate(host, dev->irq, ata_bmdma_interrupt,
 				 IRQF_SHARED, &ninja32_sht);
 }

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

A message that is not in the archive (sent off-list or not yet received): CAPDOMVgVdbDUkTLP2bKDrPr1XrzW550Hovtar3xNoESjo0x39A@mail.gmail.com

#3 lore raw
Quoted 47 lines · Nick Krause
Quoted 39 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 21 lines · Nicholas Krause

Removes the no longer valid fix me comment in the function, ninja32_init_one for questioning if we are required to remove the activated device at the end of this function by calling the function, ata_host_activate to activate the device passed by the caller of the function ninja_init_one. This comment is no longer needed as we need to deallocate the memory used to store this device's information when the device is no longer in use by the system in order to avoid leaking memory. Due to this the driver in the file,ninja32_init_one has the function,ata_pci_remove_one to release the memory allocated in it's init function and therefore this comment can now be removed due to use correctly freeing the memory allocated from the driver's init function,ninja32_init_one.

---
 drivers/ata/pata_ninja32.c | 1 -
 1 file changed, 1 deletion(-)
drivers/ata/pata_ninja32.c +0 -0
index efb272d..47b30d3 100644

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 150

Quoted 4 lines
drivers/ata/pata_ninja32.c +0 -1
@@ -147,7 +147,6 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
      ap->pflags = ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
 
      ninja32_program(base);
-     /* FIXME: Should we disable them at remove ? */

After looking at the driver history I think that the comment is about ninja32_program() enabling interrupt lines (which don't get disabled when the host controller is detached from the driver) not about the cleanup done during ata_pci_remove_one(). Alan, is this correct?

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 152

Quoted 3 lines
drivers/ata/pata_ninja32.c +0 -0
      return ata_host_activate(host, dev->irq, ata_bmdma_interrupt,
                               IRQF_SHARED, &ninja32_sht);
 }
Quoted 6 lines

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 3 lines

If that is the case then I will disable the interrupt lines for the host in this driver's
remove function.

Unless you have hardware to test such change (to check that there are no side-effects) just moving FIXME to ninja32_program() seems to be a better approach for now..

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

A message that is not in the archive (sent off-list or not yet received): CAPDOMViaa1h2SCwL92HvZC5SBk6kcwpuMkPpaKRkTNNOg0VEGg@mail.gmail.com

#5 lore raw
Quoted 58 lines · Nick Krause
Quoted 56 lines · Bartlomiej Zolnierkiewicz
Quoted 47 lines · Nick Krause
Quoted 39 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 21 lines · Nicholas Krause

Removes the no longer valid fix me comment in the function, ninja32_init_one for questioning if we are required to remove the activated device at the end of this function by calling the function, ata_host_activate to activate the device passed by the caller of the function ninja_init_one. This comment is no longer needed as we need to deallocate the memory used to store this device's information when the device is no longer in use by the system in order to avoid leaking memory. Due to this the driver in the file,ninja32_init_one has the function,ata_pci_remove_one to release the memory allocated in it's init function and therefore this comment can now be removed due to use correctly freeing the memory allocated from the driver's init function,ninja32_init_one.

---
 drivers/ata/pata_ninja32.c | 1 -
 1 file changed, 1 deletion(-)
drivers/ata/pata_ninja32.c +0 -0
index efb272d..47b30d3 100644

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 150

Quoted 4 lines
drivers/ata/pata_ninja32.c +0 -1
@@ -147,7 +147,6 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id)
      ap->pflags = ATA_PFLAG_PIO32 | ATA_PFLAG_PIO32CHANGE;
 
      ninja32_program(base);
-     /* FIXME: Should we disable them at remove ? */

After looking at the driver history I think that the comment is about ninja32_program() enabling interrupt lines (which don't get disabled when the host controller is detached from the driver) not about the cleanup done during ata_pci_remove_one(). Alan, is this correct?

drivers/ata/pata_ninja32.c static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · line 152

Quoted 3 lines
drivers/ata/pata_ninja32.c +0 -0
      return ata_host_activate(host, dev->irq, ata_bmdma_interrupt,
                               IRQF_SHARED, &ninja32_sht);
 }
Quoted 6 lines

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 3 lines

If that is the case then I will disable the interrupt lines for the host in this driver's
remove function.

Unless you have hardware to test such change (to check that there are no side-effects) just moving FIXME to ninja32_program() seems to be a better approach for now..

Quoted 7 lines
Quoted 6 lines

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Very well I will send in a patch moving this fix me.

Please wait with this to give a chance for somebody more familiar with pata_ninja32 driver/hardware to comment on it. There is absolutely no need to rush with this change..

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics