From: Alexander Shiyan <shc_work@mail.ru>
To: linux-ide@vger.kernel.org
Cc: Tejun Heo <tj@kernel.org>, Alexander Shiyan <shc_work@mail.ru>
Subject: [PATCH 4/4] pata_platform: Use 16-bit wide data transfer
Date: Sat, 23 Aug 2014 14:46:12 +0400 [thread overview]
Message-ID: <1408790772-5305-3-git-send-email-shc_work@mail.ru> (raw)
In-Reply-To: <1408790772-5305-1-git-send-email-shc_work@mail.ru>
In some cases, system bus can be configured for 16-bit mode, in this
case using of read/write functions for the 32 bit values causes two
cycles of 16 bits, which is incorrect.
The patch provides its own function to use the proper 16-bit mode.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
drivers/ata/pata_platform.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/pata_platform.c b/drivers/ata/pata_platform.c
index ecbc3bf..79dd223 100644
--- a/drivers/ata/pata_platform.c
+++ b/drivers/ata/pata_platform.c
@@ -43,13 +43,28 @@ static int pata_platform_set_mode(struct ata_link *link, struct ata_device **unu
return 0;
}
+static unsigned int pata_platform_xfer_noirq(struct ata_device *dev,
+ unsigned char *buf,
+ unsigned int buflen, int rw)
+{
+ unsigned long flags;
+ unsigned int consumed;
+
+ local_irq_save(flags);
+ /* Use 16-bit transfer */
+ consumed = ata_sff_data_xfer(dev, buf, buflen, rw);
+ local_irq_restore(flags);
+
+ return consumed;
+}
+
static struct scsi_host_template pata_platform_sht = {
ATA_PIO_SHT(DRV_NAME),
};
static struct ata_port_operations pata_platform_port_ops = {
.inherits = &ata_sff_port_ops,
- .sff_data_xfer = ata_sff_data_xfer_noirq,
+ .sff_data_xfer = pata_platform_xfer_noirq,
.cable_detect = ata_cable_unknown,
.set_mode = pata_platform_set_mode,
};
--
1.8.5.5
next prev parent reply other threads:[~2014-08-23 10:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-23 10:46 [PATCH 1/4] pata_of_platform: Remove "electra-ide" quirk Alexander Shiyan
2014-08-23 10:46 ` [PATCH 3/4] pata_platform: Use devm_ioremap_resource() Alexander Shiyan
2014-08-23 16:58 ` Tejun Heo
2014-08-23 10:46 ` Alexander Shiyan [this message]
2014-08-23 16:53 ` [PATCH 4/4] pata_platform: Use 16-bit wide data transfer Tejun Heo
2014-08-23 17:29 ` Alexander Shiyan
2014-08-25 19:34 ` Tejun Heo
2014-08-25 19:48 ` One Thousand Gnomes
2014-08-26 8:55 ` Alexander Shiyan
2014-09-18 16:40 ` Alexander Shiyan
2014-09-18 17:29 ` Tejun Heo
2014-08-23 17:06 ` [PATCH 1/4] pata_of_platform: Remove "electra-ide" quirk Tejun Heo
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=1408790772-5305-3-git-send-email-shc_work@mail.ru \
--to=shc_work@mail.ru \
--cc=linux-ide@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 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).