From: Christoph Hellwig <hch@infradead.org>
To: Tycho Andersen <tycho@docker.com>
Cc: Tejun Heo <tj@kernel.org>,
Juerg Haefliger <juerg.haefliger@hpe.com>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-hardening@lists.openwall.com
Subject: Re: [PATCH] ata-sff: always map page before data transfer
Date: Thu, 4 May 2017 02:51:34 -0700 [thread overview]
Message-ID: <20170504095134.GA14372@infradead.org> (raw)
In-Reply-To: <20170502162932.12578-1-tycho@docker.com>
> I don't understand all the factors at play here, so thoughts are definitely
> welcome.
I don't fully understand the old code either. One thing that is weird
is the "use a bounce buffer comment" which doesn't make any sense.
The other is the local_irq_save, which isn't really needed for
kmap_atomic to start with, but maybe that's the reason why the original
author didn't want to do it unconditionally?
So based on that:
> + /* FIXME: use a bounce buffer */
drop this comment..
> + local_irq_save(flags);
.. remove the local_irq_save/local_irq_restore ..
> + /* do the actual data transfer */
> + ap->ops->sff_data_xfer(qc, buf + offset, qc->sect_size,
> + do_write);
.. and a nice alittle cleanup move the do_write onto the previous line.
> + /* FIXME: use bounce buffer */
> + local_irq_save(flags);
> + buf = kmap_atomic(page);
>
> + /* do the actual data transfer */
> + consumed = ap->ops->sff_data_xfer(qc, buf + offset,
> + count, rw);
And same here.
And we should be fine.
next prev parent reply other threads:[~2017-05-04 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 16:29 [PATCH] ata-sff: always map page before data transfer Tycho Andersen
2017-05-04 9:51 ` Christoph Hellwig [this message]
2017-05-04 22:18 ` Tycho Andersen
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=20170504095134.GA14372@infradead.org \
--to=hch@infradead.org \
--cc=juerg.haefliger@hpe.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=tycho@docker.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox