Impact: cleanup
It saves us some sourcse lines and shift
the code a bit righter.And a multiline comment style is fixed too :-)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
arch/x86/kernel/apic.c | 116 ++++++++++++++++++++++---------------------------
1 file changed, 53 insertions(+), 63 deletions(-)Index: linux-2.6.git/arch/x86/kernel/apic.c
===================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic.c
+++ linux-2.6.git/arch/x86/kernel/apic.c
@@ -559,13 +559,13 @@ static int __init calibrate_by_pmtimer(l
} else {
res = (((u64)deltapm) * mult) >> 22;
do_div(res, 1000000);
- printk(KERN_WARNING "APIC calibration not consistent "
+ pr_warning("APIC calibration not consistent "
"with PM Timer: %ldms instead of 100ms\n",
(long)res);
/* Correct the lapic counter value */
res = (((u64)(*delta)) * pm_100ms);
do_div(res, deltapm);
- printk(KERN_INFO "APIC delta adjusted to PM-Timer: "
+ pr_info("APIC delta adjusted to PM-Timer: "
"%lu (%ld)\n", (unsigned long)res, *delta);
*delta = (long)res;
}
@@ -645,8 +645,7 @@ static int __init calibrate_APIC_clock(v
*/
if (calibration_result < (1000000 / HZ)) {
local_irq_enable();
- printk(KERN_WARNING
- "APIC frequency too slow, disabling apic timer\n");
+ pr_warning("APIC frequency too slow, disabling apic timer\n");
return -1;
}@@ -688,8 +687,7 @@ static int __init calibrate_APIC_clock(v
local_irq_enable();if (levt->features & CLOCK_EVT_FEAT_DUMMY) {
- printk(KERN_WARNING
- "APIC timer disabled due to verification failure.\n");
+ pr_warning("APIC timer disabled due to verification failure.\n");
return -1;
}@@ -710,7 +708,7 @@ void __init setup_boot_APIC_clock(void)
* broadcast mechanism is used. On UP systems simply ignore it.
*/
if (disable_apic_timer) {
- printk(KERN_INFO "Disabling APIC timer\n");
+ pr_info("Disabling APIC timer\...
That was it: ->check_atapi_dma() needs to inspect the packet
command and only enable DMA for bulk data transfers. With this
change sata_promise successfully both reads and writes CDs.The rules for which commands should use DMA are taken from
Promise's drivers. I missed this filter originally because it
is located in their high-level Linux glue driver while I was
mostly studying their low-level hardware driver. The filter matches
the corresponding code in pata_pdc2027x.c, with the exception
of an additional no-DMA restriction for WRITE_10 with large LBA.The patch below goes on top of the first preliminary patch.
/Mikael
--- linux-2.6.20-rc3/drivers/ata/sata_promise.c.~1~ 2007-01-01 17:13:05.000000000 +0100
+++ linux-2.6.20-rc3/drivers/ata/sata_promise.c 2007-01-01 19:14:00.000000000 +0100
@@ -39,6 +39,7 @@
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/device.h>
+#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
#include <linux/libata.h>
@@ -430,16 +431,10 @@ static void pdc_qc_prep(struct ata_queue
qc->tf.protocol = ATA_PROT_DMA;
pdc_pkt_header(&qc->tf, qc->ap->prd_dma, qc->dev->devno, pp->pkt);
qc->tf.protocol = ATA_PROT_ATAPI_DMA;
- if (qc->dev->cdb_len & ~0x1E) { /* 2/4/6/8/10/12/14/16 are Ok */
- printk(KERN_ERR "%s: bad cdb_len %u\n", __FUNCTION__, qc->dev->cdb_len);
- BUG();
- }
+ /* we can represent cdb lengths 2/4/6/8/10/12/14/16 */
+ BUG_ON(qc->dev->cdb_len & ~0x1E);
pp->pkt[12] = (((qc->dev->cdb_len >> 1) & 7) << 5) | 0x00 | 0x08;
memcpy(pp->pkt+13, qc->cdb, qc->dev->cdb_len);
-#if 0
- /* pdc-ultra/cam/cam_ata.c will pad SG length to a multiple
- of 4 here, but libata has already done that for us */
-#endif
break;default:
@@ -788,7 +783,29 @@ static void pdc_exec_command_mmio(structstatic int pdc_check_atapi_dma(struct a...
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Thanks, Cyrill -- it was high time to get this done. And, BTW, at the
next opportunity please fix up your date -- I think it may confuse some
people and/or scripts. Good to know it was a Thursday though. ;)Maciej
--
applied to tip/x86/apic, thanks guys!
Ingo
--
[Maciej W. Rozycki - Sun, Nov 09, 2008 at 12:44:54PM +0000]
| On Thu, 1 Jan 1970, Cyrill Gorcunov wrote:
|
| > Impact: cleanup
| >
| > It saves us some sourcse lines and shift
| > the code a bit righter.
| >
| > And a multiline comment style is fixed too :-)
| >
| > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| > ---
| > arch/x86/kernel/apic.c | 116 ++++++++++++++++++++++---------------------------
| > 1 file changed, 53 insertions(+), 63 deletions(-)
|
| Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
|
| Thanks, Cyrill -- it was high time to get this done. And, BTW, at the
| next opportunity please fix up your date -- I think it may confuse some
| people and/or scripts. Good to know it was a Thursday though. ;)
|
| Maciej
|Thanks for review, Maciej! I really sorry for that "date" related
issue -- will debug it and try to eliminate in future.- Cyrill -
--
| Eric W. Biederman | [PATCH 02/10] sysfs: Support for preventing unmounts. |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Antonio Almeida | HTB accuracy for high speed |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 26/37] dccp: Integration of dynamic feature activation - part 1 (socket set... |
| David Miller | [GIT]: Networking |
