All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Yan <tom.ty89@gmail.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Tejun Heo <tj@kernel.org>,
	jmoyer@redhat.com, axboe@fb.com, linux-ide@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Subject: Re: [PATCH v2 2/2] libata-core: do not set dev->max_sectors for LBA48 devices
Date: Fri, 12 Aug 2016 13:18:28 +0800	[thread overview]
Message-ID: <CAGnHSEm0mGPG_y2a7hmCzQkwYE23Srozrm6eSPX8a3Q9a0y+7A@mail.gmail.com> (raw)
In-Reply-To: <yq1mvkipwx5.fsf@sermon.lab.mkp.net>

On 12 August 2016 at 10:01, Martin K. Petersen
<martin.petersen@oracle.com> wrote:
>
> Again, the point of max_hw_sectors and max_dev_sectors is to enforce the
> hard limits of controller and device respectively. Nothing else.
>

Sounds like libata-scsi is doing something wrong then. It should not
set max_hw_sectors to dev->max_sectors that is set by libata-core:

> blk_queue_max_hw_sectors(q, dev->max_sectors);

but instead it should report it as Maximum Transfer Length and let sd
set it as max_dev_sectors:

> put_unaligned_be32(dev->max_sectors, &rbuf[8]);

While max_hw_sectors will be left untouched (in the case of AHCI, for
example, since its SCSI host template does not have max_sectors set;
so max_hw_sectors will be SCSI_DEFAULT_MAX_SECTORS).

Although that means setting dev->max_sectors to a value larger than
1024 will probably be a no-op, if that's really an issue, we should
have the host templates in libata updated.

Make sense?

  reply	other threads:[~2016-08-12  5:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 14:45 [PATCH v2 1/2] libata-scsi: set max_hw_sectors again only when dev->max_sectors is set tom.ty89
2016-08-09 14:45 ` [PATCH v2 2/2] libata-core: do not set dev->max_sectors for LBA48 devices tom.ty89
2016-08-09 16:50   ` Sergei Shtylyov
2016-08-10  4:10   ` Tejun Heo
2016-08-10  8:32     ` Tom Yan
2016-08-10 15:22       ` Tejun Heo
2016-08-11  3:37       ` Martin K. Petersen
2016-08-11  9:30         ` Tom Yan
2016-08-12  2:01           ` Martin K. Petersen
2016-08-12  5:18             ` Tom Yan [this message]
2016-08-12  8:17               ` Tom Yan
2016-08-12 21:06               ` Martin K. Petersen
2016-08-12  9:16             ` One Thousand Gnomes
2016-08-12 21:17               ` Martin K. Petersen

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=CAGnHSEm0mGPG_y2a7hmCzQkwYE23Srozrm6eSPX8a3Q9a0y+7A@mail.gmail.com \
    --to=tom.ty89@gmail.com \
    --cc=axboe@fb.com \
    --cc=jmoyer@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --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.