All of lore.kernel.org
 help / color / mirror / Atom feed
* libata: init ata_print_id to 0
@ 2012-04-22  8:38 Tero Roponen
  2012-04-22 14:57 ` Dan Williams
  2012-04-23 15:32 ` Mark Lord
  0 siblings, 2 replies; 4+ messages in thread
From: Tero Roponen @ 2012-04-22  8:38 UTC (permalink / raw)
  To: linux-ide; +Cc: Dan Williams, Jeff Garzik


When comparing the dmesg between 3.4-rc3 and 3.4-rc4 I found the
following differences:

 -ata1: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
 -ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
 -ata3: DUMMY
 +ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
 +ata3: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
  ata4: DUMMY
  ata5: DUMMY
 -ata6: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47
 +ata6: DUMMY
 +ata7: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47

The change of numbering comes from commit 85d6725b7c0d7e3f ("libata:
make ata_print_id atomic") that changed lines like

	ap->print_id = ata_print_id++;
		to
	ap->print_id = atomic_inc_return(&ata_print_id);

As the latter behaves like ++ata_print_id, we must initialize
it to zero to start the numbering from one.

Signed-off-by: Tero Roponen <tero.roponen@gmail.com>

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 28db50b..23763a1 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -95,7 +95,7 @@ static unsigned int ata_dev_set_xfermode(struct ata_device *dev);
 static void ata_dev_xfermask(struct ata_device *dev);
 static unsigned long ata_dev_blacklisted(const struct ata_device *dev);
 
-atomic_t ata_print_id = ATOMIC_INIT(1);
+atomic_t ata_print_id = ATOMIC_INIT(0);
 
 struct ata_force_param {
 	const char	*name;

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

* Re: libata: init ata_print_id to 0
  2012-04-22  8:38 libata: init ata_print_id to 0 Tero Roponen
@ 2012-04-22 14:57 ` Dan Williams
  2012-04-23 15:32 ` Mark Lord
  1 sibling, 0 replies; 4+ messages in thread
From: Dan Williams @ 2012-04-22 14:57 UTC (permalink / raw)
  To: Tero Roponen; +Cc: linux-ide, Jeff Garzik

On Sun, Apr 22, 2012 at 1:38 AM, Tero Roponen <tero.roponen@gmail.com> wrote:
>
> When comparing the dmesg between 3.4-rc3 and 3.4-rc4 I found the
> following differences:
>
>  -ata1: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
>  -ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
>  -ata3: DUMMY
>  +ata2: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff100 irq 47
>  +ata3: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff180 irq 47
>  ata4: DUMMY
>  ata5: DUMMY
>  -ata6: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47
>  +ata6: DUMMY
>  +ata7: SATA max UDMA/133 abar m2048@0xf9fff000 port 0xf9fff380 irq 47
>
> The change of numbering comes from commit 85d6725b7c0d7e3f ("libata:
> make ata_print_id atomic") that changed lines like
>
>        ap->print_id = ata_print_id++;
>                to
>        ap->print_id = atomic_inc_return(&ata_print_id);
>
> As the latter behaves like ++ata_print_id, we must initialize
> it to zero to start the numbering from one.
>
> Signed-off-by: Tero Roponen <tero.roponen@gmail.com>

Acked-by: Dan Williams <dan.j.williams@intel.com>

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

* Re: libata: init ata_print_id to 0
  2012-04-22  8:38 libata: init ata_print_id to 0 Tero Roponen
  2012-04-22 14:57 ` Dan Williams
@ 2012-04-23 15:32 ` Mark Lord
  2012-04-23 16:34   ` Dan Williams
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Lord @ 2012-04-23 15:32 UTC (permalink / raw)
  To: Tero Roponen; +Cc: linux-ide, Dan Williams, Jeff Garzik

On 12-04-22 04:38 AM, Tero Roponen wrote:
..
> The change of numbering comes from commit 85d6725b7c0d7e3f ("libata:
> make ata_print_id atomic") that changed lines like
> 
> 	ap->print_id = ata_print_id++;
> 		to
> 	ap->print_id = atomic_inc_return(&ata_print_id);
> 
> As the latter behaves like ++ata_print_id, we must initialize
> it to zero to start the numbering from one.

Darn!  And here I though we'd finally end up with libata numbering
matching the scsi host numbering (on most systems).  :)


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

* Re: libata: init ata_print_id to 0
  2012-04-23 15:32 ` Mark Lord
@ 2012-04-23 16:34   ` Dan Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Williams @ 2012-04-23 16:34 UTC (permalink / raw)
  To: Mark Lord; +Cc: Tero Roponen, linux-ide, Jeff Garzik

On Mon, Apr 23, 2012 at 8:32 AM, Mark Lord <kernel@teksavvy.com> wrote:
> On 12-04-22 04:38 AM, Tero Roponen wrote:
> ..
>> The change of numbering comes from commit 85d6725b7c0d7e3f ("libata:
>> make ata_print_id atomic") that changed lines like
>>
>>       ap->print_id = ata_print_id++;
>>               to
>>       ap->print_id = atomic_inc_return(&ata_print_id);
>>
>> As the latter behaves like ++ata_print_id, we must initialize
>> it to zero to start the numbering from one.
>
> Darn!  And here I though we'd finally end up with libata numbering
> matching the scsi host numbering (on most systems).  :)
>

That would be nice.  Libsas allocates a new ata_port and id on every
hotplug event.  Whereas libata at least alllocates a port id at load
time and persists that until the driver unloads.

It makes the per-port libata.force= options impossible to use...

Although, it couldn't be scsi host number based, because we only get
one host number for an entire sas domain.

--
Dan

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

end of thread, other threads:[~2012-04-23 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-22  8:38 libata: init ata_print_id to 0 Tero Roponen
2012-04-22 14:57 ` Dan Williams
2012-04-23 15:32 ` Mark Lord
2012-04-23 16:34   ` Dan Williams

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.