* [PATCH #upstream-fixes 1/2] libata: align ap->sector_buf
@ 2009-03-02 9:53 Tejun Heo
2009-03-02 9:55 ` [PATCH #upstream-fixes 2/2] libata: don't use on-stack sense buffer Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Tejun Heo @ 2009-03-02 9:53 UTC (permalink / raw)
To: Jeff Garzik, IDE/ATA development list, Chuck Ebbert,
Robert Hancock, FUJITA Tomonori <fujita.tom>
ap->sector_buf is used as DMA target and should at least be aligned on
cacheline. This caused problems on some embedded machines.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
include/linux/libata.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c82695d..4234973 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -750,7 +750,8 @@ struct ata_port {
acpi_handle acpi_handle;
struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */
#endif
- u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
+ /* owned by EH */
+ u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned;
};
/* The following initializer overrides a method to NULL whether one of
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH #upstream-fixes 2/2] libata: don't use on-stack sense buffer
2009-03-02 9:53 [PATCH #upstream-fixes 1/2] libata: align ap->sector_buf Tejun Heo
@ 2009-03-02 9:55 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2009-03-02 9:55 UTC (permalink / raw)
To: Jeff Garzik, IDE/ATA development list, Chuck Ebbert,
Robert Hancock, FUJITA Tomonori <fujita.tom>
sense_buffer is used as DMA target and shouldn't be allocated on
stack. Use ap->sector_buf instead. This problem is spotted by Chuck
Ebbert.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Chuck Ebbert <cebbert@redhat.com>
---
drivers/ata/libata-eh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index ce2ef04..009ccc7 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2901,7 +2901,7 @@ static int atapi_eh_clear_ua(struct ata_device *dev)
int i;
for (i = 0; i < ATA_EH_UA_TRIES; i++) {
- u8 sense_buffer[SCSI_SENSE_BUFFERSIZE];
+ u8 *sense_buffer = dev->link->ap->sector_buf;
u8 sense_key = 0;
unsigned int err_mask;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-02 9:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-02 9:53 [PATCH #upstream-fixes 1/2] libata: align ap->sector_buf Tejun Heo
2009-03-02 9:55 ` [PATCH #upstream-fixes 2/2] libata: don't use on-stack sense buffer Tejun Heo
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.