All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Pylypiv <ipylypiv@google.com>
To: Niklas Cassel <cassel@kernel.org>
Cc: Damien Le Moal <dlemoal@kernel.org>, Tejun Heo <tj@kernel.org>,
	Hannes Reinecke <hare@suse.de>,
	linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/4] ata: libata: Remove redundant sense_buffer memsets
Date: Thu, 20 Jun 2024 23:21:01 +0000	[thread overview]
Message-ID: <ZnS5XVJaK1fWvkem@google.com> (raw)
In-Reply-To: <ZnQXvmvbRWQs9dpz@ryzen.lan>

On Thu, Jun 20, 2024 at 01:51:26PM +0200, Niklas Cassel wrote:
> On Tue, Jun 18, 2024 at 07:58:56PM +0000, Igor Pylypiv wrote:
> > 
> > I think we should explicitly memset buffers before passing them to
> > atapi_eh_request_sense() in atapi_eh_clear_ua() and zpready() so that
> > atapi_eh_request_sense() can have the same behavior as ata_eh_request_sense()
> > with regards to sense buffer expectations i.e. both functions will expect
> > buffers that are already memeset to zero.
> 
> Well, you could argue that:
> static bool ata_eh_request_sense(struct ata_queued_cmd *qc)
> doesn't take a sense_buffer, but:
> 
> unsigned int atapi_eh_request_sense(struct ata_device *dev,
>                                     u8 *sense_buf, u8 dfl_sense_key)
> 
> does, so it makes sense for atapi_eh_request_sense() to memset() the buffer.
> 
> 
> > I think that it is still benefitial to remove the redundant memset() from
> > the ata_eh_analyze_tf() -> atapi_eh_request_sense() path?
> 
> atapi_eh_request_sense() should only be called when ATA_SENSE bit is set,
> so this is only called in special circumstances, so it is not like the
> memset() is in the hot path.
> 
> If you ask me, I think that the current code is fine.
> 

I didn't think about the "takes a sense_buffer as an argument" vs "doesn't take
a sense_buffer as an argument" aspect. Yeah, keeping memset() makes sense in
this case. I'll drop the memset removal from atapi_eh_request_sense() in v2.

Thank you!
Igor

> 
> Kind regards,
> Niklas

  reply	other threads:[~2024-06-20 23:21 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-14 19:18 [PATCH v1 0/4] ATA PASS-THROUGH sense data fixes Igor Pylypiv
2024-06-14 19:18 ` [PATCH v1 1/4] ata: libata: Remove redundant sense_buffer memsets Igor Pylypiv
2024-06-16 23:13   ` Damien Le Moal
2024-06-18 19:31     ` Igor Pylypiv
2024-06-17 10:41   ` Niklas Cassel
2024-06-18 19:58     ` Igor Pylypiv
2024-06-20 11:51       ` Niklas Cassel
2024-06-20 23:21         ` Igor Pylypiv [this message]
2024-06-14 19:18 ` [PATCH v1 2/4] ata: libata-scsi: Generate ATA PT sense data when ATA ERR/DF are set Igor Pylypiv
2024-06-16 23:22   ` Damien Le Moal
2024-06-18  1:13     ` Igor Pylypiv
2024-06-20 13:12       ` Niklas Cassel
2024-06-20 23:24         ` Igor Pylypiv
2024-06-17 11:29   ` Niklas Cassel
2024-06-17 12:37     ` Niklas Cassel
2024-06-18 21:51     ` Igor Pylypiv
2024-06-20 12:55       ` Niklas Cassel
2024-06-21  0:05         ` Damien Le Moal
2024-06-21 11:41           ` Niklas Cassel
2024-06-14 19:18 ` [PATCH v1 3/4] ata: libata-scsi: Report valid sense data for ATA PT if present Igor Pylypiv
2024-06-16 23:25   ` Damien Le Moal
2024-06-18  0:02     ` Igor Pylypiv
2024-06-18  2:20       ` Damien Le Moal
2024-06-17 10:49   ` Niklas Cassel
2024-06-17 23:31     ` Igor Pylypiv
2024-06-20 14:24       ` Niklas Cassel
2024-06-20 14:39         ` Niklas Cassel
2024-06-20 23:34         ` Igor Pylypiv
2024-06-14 19:18 ` [PATCH v1 4/4] ata: libata-scsi: Fix offsets for the fixed format sense data Igor Pylypiv
2024-06-16 23:37   ` Damien Le Moal
2024-06-18  1:51     ` Igor Pylypiv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnS5XVJaK1fWvkem@google.com \
    --to=ipylypiv@google.com \
    --cc=cassel@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hare@suse.de \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.