linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/6] libata: Add ata_host_flags
@ 2006-06-07 16:25 Brian King
  2006-06-12  3:26 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Brian King @ 2006-06-07 16:25 UTC (permalink / raw)
  To: jgarzik; +Cc: linux-ide, linux-scsi, brking


Since SATA devices attached to SAS HBAs will not have
a host_set, add a helper function to retrieve the host_set
flags which can check for the existence of a host_set.

Signed-off-by: Brian King <brking@us.ibm.com>
---

 libata-dev-bjking1/drivers/scsi/libata-core.c |    7 +++----
 libata-dev-bjking1/include/linux/libata.h     |    7 +++++++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/libata-core.c~libata_sas_no_simplex drivers/scsi/libata-core.c
--- libata-dev/drivers/scsi/libata-core.c~libata_sas_no_simplex	2006-06-06 08:55:43.000000000 -0500
+++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-06-06 08:55:43.000000000 -0500
@@ -2161,7 +2161,7 @@ int ata_set_mode(struct ata_port *ap, st
 	/* Record simplex status. If we selected DMA then the other
 	 * host channels are not permitted to do so.
 	 */
-	if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX))
+	if (used_dma && (ata_host_flags(ap) & ATA_HOST_SIMPLEX))
 		ap->host_set->simplex_claimed = 1;
 
 	/* step5: chip specific finalisation */
@@ -3012,7 +3012,6 @@ static int ata_dma_blacklisted(const str
 static void ata_dev_xfermask(struct ata_device *dev)
 {
 	struct ata_port *ap = dev->ap;
-	struct ata_host_set *hs = ap->host_set;
 	unsigned long xfer_mask;
 	int i;
 
@@ -3050,8 +3049,8 @@ static void ata_dev_xfermask(struct ata_
 		ata_dev_printk(dev, KERN_WARNING,
 			       "device is on DMA blacklist, disabling DMA\n");
 
-	if (hs->flags & ATA_HOST_SIMPLEX) {
-		if (hs->simplex_claimed)
+	if (ata_host_flags(ap) & ATA_HOST_SIMPLEX) {
+		if (ap->host_set->simplex_claimed)
 			xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
 	}
 
diff -puN include/linux/libata.h~libata_sas_no_simplex include/linux/libata.h
--- libata-dev/include/linux/libata.h~libata_sas_no_simplex	2006-06-06 08:55:43.000000000 -0500
+++ libata-dev-bjking1/include/linux/libata.h	2006-06-06 08:55:43.000000000 -0500
@@ -1103,4 +1103,11 @@ static inline struct ata_port *ata_shost
 	return (struct ata_port *) &host->hostdata[0];
 }
 
+static inline unsigned int ata_host_flags(struct ata_port *ap)
+{
+	if (ap->host_set)
+		return ap->host_set->flags;
+	return 0;
+}
+
 #endif /* __LINUX_LIBATA_H__ */
_

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

* Re: [PATCH 4/6] libata: Add ata_host_flags
  2006-06-07 16:25 [PATCH 4/6] libata: Add ata_host_flags Brian King
@ 2006-06-12  3:26 ` Jeff Garzik
  2006-06-12 18:33   ` Brian King
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2006-06-12  3:26 UTC (permalink / raw)
  To: Brian King; +Cc: linux-ide, linux-scsi, Alan Cox

Brian King wrote:
> Since SATA devices attached to SAS HBAs will not have
> a host_set, add a helper function to retrieve the host_set
> flags which can check for the existence of a host_set.
> 
> Signed-off-by: Brian King <brking@us.ibm.com>
> ---
> 
>  libata-dev-bjking1/drivers/scsi/libata-core.c |    7 +++----
>  libata-dev-bjking1/include/linux/libata.h     |    7 +++++++
>  2 files changed, 10 insertions(+), 4 deletions(-)
> 
> diff -puN drivers/scsi/libata-core.c~libata_sas_no_simplex drivers/scsi/libata-core.c
> --- libata-dev/drivers/scsi/libata-core.c~libata_sas_no_simplex	2006-06-06 08:55:43.000000000 -0500
> +++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-06-06 08:55:43.000000000 -0500
> @@ -2161,7 +2161,7 @@ int ata_set_mode(struct ata_port *ap, st
>  	/* Record simplex status. If we selected DMA then the other
>  	 * host channels are not permitted to do so.
>  	 */
> -	if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX))
> +	if (used_dma && (ata_host_flags(ap) & ATA_HOST_SIMPLEX))

I'm not sure I like this one.  Will have to think a bit more on this -- 
there might be a need for ipr to carry some cross-port libata state.

	Jeff



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

* Re: [PATCH 4/6] libata: Add ata_host_flags
  2006-06-12  3:26 ` Jeff Garzik
@ 2006-06-12 18:33   ` Brian King
  2006-06-26 18:56     ` Brian King
  0 siblings, 1 reply; 5+ messages in thread
From: Brian King @ 2006-06-12 18:33 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-scsi, Alan Cox

Jeff Garzik wrote:
> Brian King wrote:
>> Since SATA devices attached to SAS HBAs will not have
>> a host_set, add a helper function to retrieve the host_set
>> flags which can check for the existence of a host_set.
>>
>> Signed-off-by: Brian King <brking@us.ibm.com>
>> ---
>>
>>  libata-dev-bjking1/drivers/scsi/libata-core.c |    7 +++----
>>  libata-dev-bjking1/include/linux/libata.h     |    7 +++++++
>>  2 files changed, 10 insertions(+), 4 deletions(-)
>>
>> diff -puN drivers/scsi/libata-core.c~libata_sas_no_simplex drivers/scsi/libata-core.c
>> --- libata-dev/drivers/scsi/libata-core.c~libata_sas_no_simplex	2006-06-06 08:55:43.000000000 -0500
>> +++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-06-06 08:55:43.000000000 -0500
>> @@ -2161,7 +2161,7 @@ int ata_set_mode(struct ata_port *ap, st
>>  	/* Record simplex status. If we selected DMA then the other
>>  	 * host channels are not permitted to do so.
>>  	 */
>> -	if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX))
>> +	if (used_dma && (ata_host_flags(ap) & ATA_HOST_SIMPLEX))
> 
> I'm not sure I like this one.  Will have to think a bit more on this -- 
> there might be a need for ipr to carry some cross-port libata state.

I can't think of any need at this point. Would it be reasonable to go ahead
with this change and add in the support for a cross-port libata state
if and when such a need comes along? 


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

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

* Re: [PATCH 4/6] libata: Add ata_host_flags
  2006-06-12 18:33   ` Brian King
@ 2006-06-26 18:56     ` Brian King
  2006-06-26 20:54       ` Alan Cox
  0 siblings, 1 reply; 5+ messages in thread
From: Brian King @ 2006-06-26 18:56 UTC (permalink / raw)
  To: brking; +Cc: Jeff Garzik, linux-ide, linux-scsi, Alan Cox

Brian King wrote:
> Jeff Garzik wrote:
>> Brian King wrote:
>>> Since SATA devices attached to SAS HBAs will not have
>>> a host_set, add a helper function to retrieve the host_set
>>> flags which can check for the existence of a host_set.
>>>
>>> Signed-off-by: Brian King <brking@us.ibm.com>
>>> ---
>>>
>>>  libata-dev-bjking1/drivers/scsi/libata-core.c |    7 +++----
>>>  libata-dev-bjking1/include/linux/libata.h     |    7 +++++++
>>>  2 files changed, 10 insertions(+), 4 deletions(-)
>>>
>>> diff -puN drivers/scsi/libata-core.c~libata_sas_no_simplex drivers/scsi/libata-core.c
>>> --- libata-dev/drivers/scsi/libata-core.c~libata_sas_no_simplex	2006-06-06 08:55:43.000000000 -0500
>>> +++ libata-dev-bjking1/drivers/scsi/libata-core.c	2006-06-06 08:55:43.000000000 -0500
>>> @@ -2161,7 +2161,7 @@ int ata_set_mode(struct ata_port *ap, st
>>>  	/* Record simplex status. If we selected DMA then the other
>>>  	 * host channels are not permitted to do so.
>>>  	 */
>>> -	if (used_dma && (ap->host_set->flags & ATA_HOST_SIMPLEX))
>>> +	if (used_dma && (ata_host_flags(ap) & ATA_HOST_SIMPLEX))
>> I'm not sure I like this one.  Will have to think a bit more on this -- 
>> there might be a need for ipr to carry some cross-port libata state.
> 
> I can't think of any need at this point. Would it be reasonable to go ahead
> with this change and add in the support for a cross-port libata state
> if and when such a need comes along? 

Jeff, any further thoughts about this? I had been trying to avoid having
any host_set type of data for the SAS usage of libata in part due to
not seeing a need and also due to a comment Bartlomiej made a while back:

http://marc.theaimsgroup.com/?l=linux-ide&m=112842136431977&w=2


Brian

-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

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

* Re: [PATCH 4/6] libata: Add ata_host_flags
  2006-06-26 18:56     ` Brian King
@ 2006-06-26 20:54       ` Alan Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cox @ 2006-06-26 20:54 UTC (permalink / raw)
  To: brking; +Cc: Jeff Garzik, linux-ide, linux-scsi

Ar Llu, 2006-06-26 am 13:56 -0500, ysgrifennodd Brian King:
> Jeff, any further thoughts about this? I had been trying to avoid having
> any host_set type of data for the SAS usage of libata in part due to
> not seeing a need and also due to a comment Bartlomiej made a while back:
> 
> http://marc.theaimsgroup.com/?l=linux-ide&m=112842136431977&w=2

Well if anything we seem to be going the other way, in order to get
things like Simplex working with legacy mode the legacy setup needs the
two ports on the same host_set with differing IRQ/ports.

Alan


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

end of thread, other threads:[~2006-06-26 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-07 16:25 [PATCH 4/6] libata: Add ata_host_flags Brian King
2006-06-12  3:26 ` Jeff Garzik
2006-06-12 18:33   ` Brian King
2006-06-26 18:56     ` Brian King
2006-06-26 20:54       ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).