diff mbox series

[1/3] ata: libata: Introduce ata_qc_has_cdl()

Message ID 20230817214137.462044-1-ipylypiv@google.com (mailing list archive)
State Superseded
Headers show
Series [1/3] ata: libata: Introduce ata_qc_has_cdl() | expand

Commit Message

Igor Pylypiv Aug. 17, 2023, 9:41 p.m. UTC
Introduce the inline helper function ata_qc_has_cdl() to test if
a queued command has a Command Duration Limits descriptor set.

Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
---
 include/linux/libata.h | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Damien Le Moal Aug. 17, 2023, 11:11 p.m. UTC | #1
On 2023/08/18 6:41, Igor Pylypiv wrote:
> Introduce the inline helper function ata_qc_has_cdl() to test if
> a queued command has a Command Duration Limits descriptor set.
> 
> Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
> ---
>  include/linux/libata.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/libata.h b/include/linux/libata.h
> index 820f7a3a2749..bc7870f1f527 100644
> --- a/include/linux/libata.h
> +++ b/include/linux/libata.h
> @@ -1062,6 +1062,11 @@ static inline bool ata_port_is_frozen(const struct ata_port *ap)
>  	return ap->pflags & ATA_PFLAG_FROZEN;
>  }
>  
> +static inline bool ata_qc_has_cdl(struct ata_queued_cmd *qc)
> +{
> +	return qc->flags & ATA_QCFLAG_HAS_CDL;
> +}

This is used in one place only in patch 3, and the only other place we test this
flag is in ata_build_rw_tf(). So I do not think this is necessary. Let's drop this.

> +
>  extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
>  extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
>  				int (*check_ready)(struct ata_link *link));
Igor Pylypiv Aug. 18, 2023, 8:47 p.m. UTC | #2
On Fri, Aug 18, 2023 at 08:11:39AM +0900, Damien Le Moal wrote:
> On 2023/08/18 6:41, Igor Pylypiv wrote:
> > Introduce the inline helper function ata_qc_has_cdl() to test if
> > a queued command has a Command Duration Limits descriptor set.
> > 
> > Signed-off-by: Igor Pylypiv <ipylypiv@google.com>
> > ---
> >  include/linux/libata.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/include/linux/libata.h b/include/linux/libata.h
> > index 820f7a3a2749..bc7870f1f527 100644
> > --- a/include/linux/libata.h
> > +++ b/include/linux/libata.h
> > @@ -1062,6 +1062,11 @@ static inline bool ata_port_is_frozen(const struct ata_port *ap)
> >  	return ap->pflags & ATA_PFLAG_FROZEN;
> >  }
> >  
> > +static inline bool ata_qc_has_cdl(struct ata_queued_cmd *qc)
> > +{
> > +	return qc->flags & ATA_QCFLAG_HAS_CDL;
> > +}
> 
> This is used in one place only in patch 3, and the only other place we test this
> flag is in ata_build_rw_tf(). So I do not think this is necessary. Let's drop this.

Thanks Damien! I'll drop this patch in v2.
As discussed in PATCH 2/3 we'll check for ATA_QCFLAG_RESULT_TF instead.

> 
> > +
> >  extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
> >  extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
> >  				int (*check_ready)(struct ata_link *link));
> 
> -- 
> Damien Le Moal
> Western Digital Research
>

Thanks,
Igor
diff mbox series

Patch

diff --git a/include/linux/libata.h b/include/linux/libata.h
index 820f7a3a2749..bc7870f1f527 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -1062,6 +1062,11 @@  static inline bool ata_port_is_frozen(const struct ata_port *ap)
 	return ap->pflags & ATA_PFLAG_FROZEN;
 }
 
+static inline bool ata_qc_has_cdl(struct ata_queued_cmd *qc)
+{
+	return qc->flags & ATA_QCFLAG_HAS_CDL;
+}
+
 extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
 extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
 				int (*check_ready)(struct ata_link *link));