[libata] AHCI: add hw link power management support

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=31556594f913fa81d008cecfe46d7211c919a853
Commit: 31556594f913fa81d008cecfe46d7211c919a853
Parent: ca77329fb713b7fea6a307068e0dd0248e7aa640
Author: Kristen Carlson Accardi [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 01:33:26 2007 -0400
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:00:35 2007 -0400

[libata] AHCI: add hw link power management support

This patch will set the correct bits to turn on Aggressive
Link Power Management (ALPM) for the ahci driver.  This
will cause the controller and disk to negotiate a lower
power state for the link when there is no activity (see
the AHCI 1.x spec for details).  This feature is mutually
exclusive with Hot Plug, so when ALPM is enabled, Hot Plug
is disabled.  ALPM will be enabled by default, but it is
settable via the scsi host syfs interface.  Possible
settings for this feature are:

Setting Effect
--
min_power   ALPM is enabled, and link set to enter
lowest power state (SLUMBER) when idle
Hot plug not allowed.

max_performance ALPM is disabled, Hot Plug is allowed

medium_powerALPM is enabled, and link set to enter
second lowest power state (PARTIAL) when
idle.  Hot plug not allowed.

Signed-off-by:  Kristen Carlson Accardi [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/ahci.c |  157 +++-
 1 files changed, 155 insertions(+), 2 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index c8ab947..ed9b407 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -49,6 +49,9 @@
 #define DRV_NAME   ahci
 #define DRV_VERSION3.0
 
+static int ahci_enable_alpm(struct ata_port *ap,
+   enum link_pm policy);
+static void ahci_disable_alpm(struct ata_port *ap);
 
 enum {
AHCI_PCI_BAR= 5,
@@ -99,6 +102,7 @@ enum {
HOST_CAP_SSC= (1  14), /* Slumber capable */
HOST_CAP_PMP= (1  17), /* Port Multiplier support */
HOST_CAP_CLO= (1  24), /* Command List Override support */
+   HOST_CAP_ALPM   = (1  26), /* Aggressive Link PM support */
HOST_CAP_SSS= (1  27), /* Staggered Spin-up */
HOST_CAP_SNTF   = (1  29), /* SNotification register */
HOST_CAP_NCQ= (1  30), /* Native Command Queueing */
@@ -155,6 +159,8 @@ enum {
  PORT_IRQ_PIOS_FIS | PORT_IRQ_D2H_REG_FIS,
 
/* PORT_CMD bits */
+   PORT_CMD_ASP= (1  27), /* Aggressive Slumber/Partial */
+   PORT_CMD_ALPE   = (1  26), /* Aggressive Link PM enable */
PORT_CMD_ATAPI  = (1  24), /* Device is ATAPI */
PORT_CMD_PMP= (1  17), /* PMP attached */
PORT_CMD_LIST_ON= (1  15), /* cmd list DMA engine running */
@@ -178,13 +184,14 @@ enum {
AHCI_HFLAG_MV_PATA  = (1  4), /* PATA port */
AHCI_HFLAG_NO_MSI   = (1  5), /* no PCI MSI */
AHCI_HFLAG_NO_PMP   = (1  6), /* no PMP */
+   AHCI_HFLAG_NO_HOTPLUG   = (1  7), /* ignore PxSERR.DIAG.N */
 
/* ap-flags bits */
-   AHCI_FLAG_NO_HOTPLUG= (1  24), /* ignore PxSERR.DIAG.N */
 
AHCI_FLAG_COMMON= ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY |
  ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA |
- ATA_FLAG_ACPI_SATA | ATA_FLAG_AN,
+ ATA_FLAG_ACPI_SATA | ATA_FLAG_AN |
+ ATA_FLAG_IPM,
AHCI_LFLAG_COMMON   = ATA_LFLAG_SKIP_D2H_BSY,
 };
 
@@ -254,6 +261,11 @@ static int ahci_pci_device_suspend(struct pci_dev *pdev, 
pm_message_t mesg);
 static int ahci_pci_device_resume(struct pci_dev *pdev);
 #endif
 
+static struct class_device_attribute *ahci_shost_attrs[] = {
+   class_device_attr_link_power_management_policy,
+   NULL
+};
+
 static struct scsi_host_template ahci_sht = {
.module = THIS_MODULE,
.name   = DRV_NAME,
@@ -271,6 +283,7 @@ static struct scsi_host_template ahci_sht = {
.slave_configure= ata_scsi_slave_config,
.slave_destroy  = ata_scsi_slave_destroy,
.bios_param = ata_std_bios_param,
+   .shost_attrs= ahci_shost_attrs,
 };
 
 static const struct ata_port_operations ahci_ops = {
@@ -302,6 +315,8 @@ static const struct ata_port_operations ahci_ops = {
.port_suspend   = ahci_port_suspend,
.port_resume= ahci_port_resume,
 #endif
+   

[libata] Link power management infrastructure

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca77329fb713b7fea6a307068e0dd0248e7aa640
Commit: ca77329fb713b7fea6a307068e0dd0248e7aa640
Parent: ab6fc95f609b372a19e18ea689986846ab1ba29c
Author: Kristen Carlson Accardi [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 00:58:59 2007 -0400
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:00:35 2007 -0400

[libata] Link power management infrastructure

Device Initiated Power Management, which is defined
in SATA 2.5 can be enabled for disks which support it.
This patch enables DIPM when the user sets the link
power management policy to min_power.

Additionally, libata drivers can define a function
(enable_pm) that will perform hardware specific actions to
enable whatever power management policy the user set up
for Host Initiated Power management (HIPM).
This power management policy will be activated after all
disks have been enumerated and intialized.  Drivers should
also define disable_pm, which will turn off link power
management, but not change link power management policy.

Documentation/scsi/link_power_management_policy.txt has additional
information.

Signed-off-by:  Kristen Carlson Accardi [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 .../scsi/link_power_management_policy.txt  |   19 ++
 drivers/ata/libata-core.c  |  196 +++-
 drivers/ata/libata-eh.c|4 +
 drivers/ata/libata-scsi.c  |   68 +++
 drivers/ata/libata.h   |2 +
 include/linux/ata.h|   21 ++
 include/linux/libata.h |   21 ++-
 7 files changed, 329 insertions(+), 2 deletions(-)

diff --git a/Documentation/scsi/link_power_management_policy.txt 
b/Documentation/scsi/link_power_management_policy.txt
new file mode 100644
index 000..d18993d
--- /dev/null
+++ b/Documentation/scsi/link_power_management_policy.txt
@@ -0,0 +1,19 @@
+This parameter allows the user to set the link (interface) power management.
+There are 3 possible options:
+
+Value  Effect
+
+min_power  Tell the controller to try to make the link use the
+   least possible power when possible.  This may
+   sacrifice some performance due to increased latency
+   when coming out of lower power states.
+
+max_performanceGenerally, this means no power management.  Tell
+   the controller to have performance be a priority
+   over power management.
+
+medium_power   Tell the controller to enter a lower power state
+   when possible, but do not enter the lowest power
+   state, thus improving latency over min_power setting.
+
+
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 3891cdc..513babe 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -620,6 +620,177 @@ void ata_dev_disable(struct ata_device *dev)
}
 }
 
+static int ata_dev_set_dipm(struct ata_device *dev, enum link_pm policy)
+{
+   struct ata_link *link = dev-link;
+   struct ata_port *ap = link-ap;
+   u32 scontrol;
+   unsigned int err_mask;
+   int rc;
+
+   /*
+* disallow DIPM for drivers which haven't set
+* ATA_FLAG_IPM.  This is because when DIPM is enabled,
+* phy ready will be set in the interrupt status on
+* state changes, which will cause some drivers to
+* think there are errors - additionally drivers will
+* need to disable hot plug.
+*/
+   if (!(ap-flags  ATA_FLAG_IPM) || !ata_dev_enabled(dev)) {
+   ap-pm_policy = NOT_AVAILABLE;
+   return -EINVAL;
+   }
+
+   /*
+* For DIPM, we will only enable it for the
+* min_power setting.
+*
+* Why?  Because Disks are too stupid to know that
+* If the host rejects a request to go to SLUMBER
+* they should retry at PARTIAL, and instead it
+* just would give up.  So, for medium_power to
+* work at all, we need to only allow HIPM.
+*/
+   rc = sata_scr_read(link, SCR_CONTROL, scontrol);
+   if (rc)
+   return rc;
+
+   switch (policy) {
+   case MIN_POWER:
+   /* no restrictions on IPM transitions */
+   scontrol = ~(0x3  8);
+   rc = sata_scr_write(link, SCR_CONTROL, scontrol);
+   if (rc)
+   return rc;
+
+   /* enable DIPM */
+   if (dev-flags  ATA_DFLAG_DIPM)
+   err_mask = ata_dev_set_feature(dev,
+   

libata: add MAXTOR 7V300F0/VA111900 to NCQ blacklist

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=12850ffe71c677b30f62fc054925837f1fdc4266
Commit: 12850ffe71c677b30f62fc054925837f1fdc4266
Parent: 4fb4615bc9465e7098665fa9616b6ac1f495f895
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 17:57:44 2007 +0900
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:21:33 2007 -0400

libata: add MAXTOR 7V300F0/VA111900 to NCQ blacklist

MAXTOR 7V300F0/VA111900 does spurious NCQ completions.  Add it to
blacklist.  This problem is reported by Carsten Otto.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Cc: Carsten Otto [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index bdd8778..3891cdc 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4024,6 +4024,7 @@ static const struct ata_blacklist_entry 
ata_device_blacklist [] = {
{ ST3160812AS,3.ADJ,ATA_HORKAGE_NONCQ, },
{ ST980813AS, 3.ADB,ATA_HORKAGE_NONCQ, },
{ SAMSUNG HD401LJ,ZZ100-15, ATA_HORKAGE_NONCQ, },
+   { Maxtor 7V300F0, VA111900, ATA_HORKAGE_NONCQ, },
 
/* devices which puke on READ_NATIVE_MAX */
{ HDS724040KLSA80,KFAOA20N, ATA_HORKAGE_BROKEN_HPA, },
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pata_ns87415: define SUPERIO_IDE_MAX_RETRIES

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9efacbad1a735ec410acb26c9de72be8efb33d5
Commit: a9efacbad1a735ec410acb26c9de72be8efb33d5
Parent: 5796d1c4c89efff823259fda35b08ea66ebf8b23
Author: Frank Lichtenheld [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 02:49:20 2007 +0100
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:21:33 2007 -0400

pata_ns87415: define SUPERIO_IDE_MAX_RETRIES

Code copied from drivers/ide/pci/ns87415.c uses this, so copy the
definition from there as well.

Fixes the following build error:
  CC [M]  drivers/ata/pata_ns87415.o
drivers/ata/pata_ns87415.c: In function ‘ns87560_read_buggy’:
drivers/ata/pata_ns87415.c:228: error: ‘SUPERIO_IDE_MAX_RETRIES’ undeclared 
(first use in this function)
drivers/ata/pata_ns87415.c:228: error: (Each undeclared identifier is 
reported only once
drivers/ata/pata_ns87415.c:228: error: for each function it appears in.)

Signed-off-by: Frank Lichtenheld [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/pata_ns87415.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/pata_ns87415.c b/drivers/ata/pata_ns87415.c
index b9a17eb..d0e2e50 100644
--- a/drivers/ata/pata_ns87415.c
+++ b/drivers/ata/pata_ns87415.c
@@ -215,6 +215,8 @@ static int ns87415_check_atapi_dma(struct ata_queued_cmd 
*qc)
 
 #include asm/superio.h
 
+#define SUPERIO_IDE_MAX_RETRIES 25
+
 /**
  * ns87560_read_buggy  -   workaround buggy Super I/O chip
  * @port: Port to read
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[libata] Address some checkpatch-spotted issues

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5796d1c4c89efff823259fda35b08ea66ebf8b23
Commit: 5796d1c4c89efff823259fda35b08ea66ebf8b23
Parent: b447916e2b8c80f37aa88512ea39a05d5d11507d
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 00:03:37 2007 -0400
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:15:27 2007 -0400

[libata] Address some checkpatch-spotted issues

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/pata_pcmcia.c   |   12 ++--
 drivers/ata/pdc_adma.c  |   12 ++--
 drivers/ata/sata_inic162x.c |2 +-
 drivers/ata/sata_mv.c   |7 +-
 drivers/ata/sata_nv.c   |   70 +
 drivers/ata/sata_promise.c  |   38 ++
 drivers/ata/sata_qstor.c|3 +-
 drivers/ata/sata_sil.c  |   11 ++-
 drivers/ata/sata_sil24.c|9 +-
 drivers/ata/sata_sis.c  |   64 +
 drivers/ata/sata_svw.c  |   10 +-
 drivers/ata/sata_sx4.c  |  173 ++-
 drivers/ata/sata_uli.c  |   18 ++--
 drivers/ata/sata_via.c  |   20 +++---
 drivers/ata/sata_vsc.c  |   15 ++--
 15 files changed, 244 insertions(+), 220 deletions(-)

diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c
index 5db2013..fd36099 100644
--- a/drivers/ata/pata_pcmcia.c
+++ b/drivers/ata/pata_pcmcia.c
@@ -74,8 +74,7 @@ static int pcmcia_set_mode(struct ata_link *link, struct 
ata_device **r_failed_d
return ata_do_set_mode(link, r_failed_dev);
 
if (memcmp(master-id + ATA_ID_FW_REV,  slave-id + ATA_ID_FW_REV,
-  ATA_ID_FW_REV_LEN + ATA_ID_PROD_LEN) == 0)
-   {
+  ATA_ID_FW_REV_LEN + ATA_ID_PROD_LEN) == 0) {
/* Suspicious match, but could be two cards from
   the same vendor - check serial */
if (memcmp(master-id + ATA_ID_SERNO, slave-id + ATA_ID_SERNO,
@@ -248,7 +247,8 @@ static int pcmcia_init_one(struct pcmcia_device *pdev)
goto next_entry;
io_base = pdev-io.BasePort1;
ctl_base = pdev-io.BasePort1 + 0x0e;
-   } else goto next_entry;
+   } else
+   goto next_entry;
/* If we've got this far, we're done */
break;
}
@@ -285,8 +285,8 @@ next_entry:
printk(KERN_WARNING DRV_NAME : second channel not yet 
supported.\n);
 
/*
-*  Having done the PCMCIA plumbing the ATA side is relatively
-*  sane.
+*  Having done the PCMCIA plumbing the ATA side is relatively
+*  sane.
 */
ret = -ENOMEM;
host = ata_host_alloc(pdev-dev, 1);
@@ -363,7 +363,7 @@ static struct pcmcia_device_id pcmcia_devices[] = {
PCMCIA_DEVICE_MANF_CARD(0x0098, 0x),/* Toshiba */
PCMCIA_DEVICE_MANF_CARD(0x00a4, 0x002d),
PCMCIA_DEVICE_MANF_CARD(0x00ce, 0x),/* Samsung */
-   PCMCIA_DEVICE_MANF_CARD(0x0319, 0x),/* Hitachi */
+   PCMCIA_DEVICE_MANF_CARD(0x0319, 0x),/* Hitachi */
PCMCIA_DEVICE_MANF_CARD(0x2080, 0x0001),
PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0100),/* Viking CFA */
PCMCIA_DEVICE_MANF_CARD(0x4e01, 0x0200),/* Lexar, Viking CFA */
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index 199f7e1..bd4c2a3 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -47,10 +47,10 @@
 #define DRV_VERSION1.0
 
 /* macro to calculate base address for ATA regs */
-#define ADMA_ATA_REGS(base,port_no)((base) + ((port_no) * 0x40))
+#define ADMA_ATA_REGS(base, port_no)   ((base) + ((port_no) * 0x40))
 
 /* macro to calculate base address for ADMA regs */
-#define ADMA_REGS(base,port_no)((base) + 0x80 + ((port_no) * 
0x20))
+#define ADMA_REGS(base, port_no)   ((base) + 0x80 + ((port_no) * 0x20))
 
 /* macro to obtain addresses from ata_port */
 #define ADMA_PORT_REGS(ap) \
@@ -128,7 +128,7 @@ struct adma_port_priv {
adma_state_tstate;
 };
 
-static int adma_ata_init_one (struct pci_dev *pdev,
+static int adma_ata_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent);
 static int adma_port_start(struct ata_port *ap);
 static void adma_host_stop(struct ata_host *host);
@@ -340,8 +340,8 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
buf[i++] = 0;   /* pPKLW */
buf[i++] = 0;   /* reserved */
 
-   *(__le32 *)(buf + i)
-   = (pFLAGS  pEND) ? 0 : cpu_to_le32(pp-pkt_dma + i + 
4);
+   *(__le32 *)(buf + i) =
+   (pFLAGS  pEND) ? 0 : cpu_to_le32(pp-pkt_dma + i + 4);
i += 4;
 

libata: track SLEEP state and issue SRST to wake it up

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=054a5fbaceb2eb3a31ea843c1cf0b8e10b91478c
Commit: 054a5fbaceb2eb3a31ea843c1cf0b8e10b91478c
Parent: 4dbfa39b6c95eb9d0aedb5bd00bb552b91c31e3d
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 18:30:36 2007 +0900
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:15:25 2007 -0400

libata: track SLEEP state and issue SRST to wake it up

ATA devices in SLEEP mode don't respond to any commands.  SRST is
necessary to wake it up.  Till now, when a command is issued to a
device in SLEEP mode, the command times out, which makes EH reset the
device and retry the command after that, causing a long delay.

This patch makes libata track SLEEP state and issue SRST automatically
if a command is about to be issued to a device in SLEEP.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Cc: Bruce Allen [EMAIL PROTECTED]
Cc: Andrew Paprocki [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |   12 
 drivers/ata/libata-eh.c   |4 +++-
 include/linux/ata.h   |1 +
 include/linux/libata.h|1 +
 4 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 5aedd1a..50ae201 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5630,6 +5630,10 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
ehi-dev_action[dev-devno] |= ATA_EH_REVALIDATE;
ata_port_schedule_eh(ap);
break;
+
+   case ATA_CMD_SLEEP:
+   dev-flags |= ATA_DFLAG_SLEEPING;
+   break;
}
 
__ata_qc_complete(qc);
@@ -5769,6 +5773,14 @@ void ata_qc_issue(struct ata_queued_cmd *qc)
qc-flags = ~ATA_QCFLAG_DMAMAP;
}
 
+   /* if device is sleeping, schedule softreset and abort the link */
+   if (unlikely(qc-dev-flags  ATA_DFLAG_SLEEPING)) {
+   link-eh_info.action |= ATA_EH_SOFTRESET;
+   ata_ehi_push_desc(link-eh_info, waking up from sleep);
+   ata_link_abort(link);
+   return;
+   }
+
ap-ops-qc_prep(qc);
 
qc-err_mask |= ap-ops-qc_issue(qc);
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 8cb35bb..496edaf 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2208,9 +2208,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
ata_link_for_each_dev(dev, link) {
/* After the reset, the device state is PIO 0
 * and the controller state is undefined.
-* Record the mode.
+* Reset also wakes up drives from sleeping
+* mode.
 */
dev-pio_mode = XFER_PIO_0;
+   dev-flags = ~ATA_DFLAG_SLEEPING;
 
if (ata_link_offline(link))
continue;
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 8263a7b..e21c002 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -180,6 +180,7 @@ enum {
ATA_CMD_VERIFY_EXT  = 0x42,
ATA_CMD_STANDBYNOW1 = 0xE0,
ATA_CMD_IDLEIMMEDIATE   = 0xE1,
+   ATA_CMD_SLEEP   = 0xE6,
ATA_CMD_INIT_DEV_PARAMS = 0x91,
ATA_CMD_READ_NATIVE_MAX = 0xF8,
ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 6fd24e0..2f0fc63 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -138,6 +138,7 @@ enum {
ATA_DFLAG_PIO   = (1  12), /* device limited to PIO mode */
ATA_DFLAG_NCQ_OFF   = (1  13), /* device limited to non-NCQ mode 
*/
ATA_DFLAG_SPUNDOWN  = (1  14), /* XXX: for spindown_compat */
+   ATA_DFLAG_SLEEPING  = (1  15), /* device is sleeping */
ATA_DFLAG_INIT_MASK = (1  16) - 1,
 
ATA_DFLAG_DETACH= (1  16),
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libata: relocate and fix post-command processing

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4dbfa39b6c95eb9d0aedb5bd00bb552b91c31e3d
Commit: 4dbfa39b6c95eb9d0aedb5bd00bb552b91c31e3d
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 18:22:44 2007 +0900
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:15:25 2007 -0400

libata: relocate and fix post-command processing

Some commands need post-processing after successful completion.  This
was done in ata_scsi_qc_complete() till now but this has the following
problems.

* Post-command processing gets executed when qc is completed from EH.
  Some qc's are retried from EH with zero err_mask and thus triggers
  unnecessary/incorrect post-command processing.

* Command post processing doesn't belong to SAT layer.

* Link-wide revalidation was scheduled where device revalidation
  suffices.

This patch moves post-command processing to success completion path of
ata_qc_complete() which is travelled iff the command is going to be
completed without passing through EH and updates post-command
processing such that device-specific action is used.  While at it,
restructure code a bit for readability.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |   20 
 drivers/ata/libata-scsi.c |   23 ---
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 081e3df..5aedd1a 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -5594,6 +5594,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
 * taken care of.
 */
if (ap-ops-error_handler) {
+   struct ata_device *dev = qc-dev;
+   struct ata_eh_info *ehi = dev-link-eh_info;
+
WARN_ON(ap-pflags  ATA_PFLAG_FROZEN);
 
if (unlikely(qc-err_mask))
@@ -5612,6 +5615,23 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
if (qc-flags  ATA_QCFLAG_RESULT_TF)
fill_result_tf(qc);
 
+   /* Some commands need post-processing after successful
+* completion.
+*/
+   switch (qc-tf.command) {
+   case ATA_CMD_SET_FEATURES:
+   if (qc-tf.feature != SETFEATURES_WC_ON 
+   qc-tf.feature != SETFEATURES_WC_OFF)
+   break;
+   /* fall through */
+   case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */
+   case ATA_CMD_SET_MULTI: /* multi_count changed */
+   /* revalidate device */
+   ehi-dev_action[dev-devno] |= ATA_EH_REVALIDATE;
+   ata_port_schedule_eh(ap);
+   break;
+   }
+
__ata_qc_complete(qc);
} else {
if (qc-flags  ATA_QCFLAG_EH_SCHEDULED)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index f5d5420..f752edd 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1361,33 +1361,10 @@ nothing_to_do:
 static void ata_scsi_qc_complete(struct ata_queued_cmd *qc)
 {
struct ata_port *ap = qc-ap;
-   struct ata_eh_info *ehi = qc-dev-link-eh_info;
struct scsi_cmnd *cmd = qc-scsicmd;
u8 *cdb = cmd-cmnd;
int need_sense = (qc-err_mask != 0);
 
-   /* We snoop the SET_FEATURES - Write Cache ON/OFF command, and
-* schedule EH_REVALIDATE operation to update the IDENTIFY DEVICE
-* cache
-*/
-   if (ap-ops-error_handler  !need_sense) {
-   switch (qc-tf.command) {
-   case ATA_CMD_SET_FEATURES:
-   if ((qc-tf.feature == SETFEATURES_WC_ON) ||
-   (qc-tf.feature == SETFEATURES_WC_OFF)) {
-   ehi-action |= ATA_EH_REVALIDATE;
-   ata_port_schedule_eh(ap);
-   }
-   break;
-
-   case ATA_CMD_INIT_DEV_PARAMS: /* CHS translation changed */
-   case ATA_CMD_SET_MULTI: /* multi_count changed */
-   ehi-action |= ATA_EH_REVALIDATE;
-   ata_port_schedule_eh(ap);
-   break;
-   }
-   }
-
/* For ATA pass thru (SAT) commands, generate a sense block if
 * user mandated it or if there's an error.  Note that if we
 * generate because the user forced us to, a check condition
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


netdrvr/pcmcia: use IRQ_TYPE_DYNAMIC_SHARING flag for irq.Attributes.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e7bf8cc60d29354305cc76daa21a7d92745521c
Commit: 5e7bf8cc60d29354305cc76daa21a7d92745521c
Parent: 5d031e9e7e9ad5aa6516646f955c6262478e1acd
Author: Komuro [EMAIL PROTECTED]
AuthorDate: Sun Oct 28 11:26:17 2007 +0900
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:07:05 2007 -0400

netdrvr/pcmcia: use IRQ_TYPE_DYNAMIC_SHARING flag for irq.Attributes.

The drivers below support IRQ-sharing.

3c574_cs, 3c589_cs, pcnet_cs,
axnet_cs, smc91c92_cs, fmvj18x_cs.
xirc2ps_cs, serial_cs.

Signed-off-by: Komuro [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/pcmcia/3c574_cs.c|2 +-
 drivers/net/pcmcia/3c589_cs.c|2 +-
 drivers/net/pcmcia/axnet_cs.c|2 +-
 drivers/net/pcmcia/fmvj18x_cs.c  |2 +-
 drivers/net/pcmcia/pcnet_cs.c|2 +-
 drivers/net/pcmcia/smc91c92_cs.c |2 +-
 drivers/net/pcmcia/xirc2ps_cs.c  |2 +-
 drivers/serial/serial_cs.c   |2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 73dcbb7..ad134a6 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -274,7 +274,7 @@ static int tc574_probe(struct pcmcia_device *link)
spin_lock_init(lp-window_lock);
link-io.NumPorts1 = 32;
link-io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-   link-irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+   link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
link-irq.IRQInfo1 = IRQ_LEVEL_ID;
link-irq.Handler = el3_interrupt;
link-irq.Instance = dev;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 32076ca..a98fe07 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -188,7 +188,7 @@ static int tc589_probe(struct pcmcia_device *link)
 spin_lock_init(lp-lock);
 link-io.NumPorts1 = 16;
 link-io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-link-irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
 link-irq.IRQInfo1 = IRQ_LEVEL_ID;
 link-irq.Handler = el3_interrupt;
 link-irq.Instance = dev;
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index a95a2ca..8d910a3 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -158,7 +158,7 @@ static int axnet_probe(struct pcmcia_device *link)
 info = PRIV(dev);
 info-p_dev = link;
 link-priv = dev;
-link-irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 link-irq.IRQInfo1 = IRQ_LEVEL_ID;
 link-conf.Attributes = CONF_ENABLE_IRQ;
 link-conf.IntType = INT_MEMORY_AND_IO;
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 6284467..8c719b4 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -249,7 +249,7 @@ static int fmvj18x_probe(struct pcmcia_device *link)
 link-io.IOAddrLines = 5;
 
 /* Interrupt setup */
-link-irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
 link-irq.IRQInfo1 = IRQ_LEVEL_ID;
 link-irq.Handler = fjn_interrupt;
 link-irq.Instance = dev;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 9d45e96..db6a97d 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -254,7 +254,7 @@ static int pcnet_probe(struct pcmcia_device *link)
 info-p_dev = link;
 link-priv = dev;
 
-link-irq.Attributes = IRQ_TYPE_EXCLUSIVE;
+link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
 link-irq.IRQInfo1 = IRQ_LEVEL_ID;
 link-conf.Attributes = CONF_ENABLE_IRQ;
 link-conf.IntType = INT_MEMORY_AND_IO;
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 58d716f..c9868e9 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -328,7 +328,7 @@ static int smc91c92_probe(struct pcmcia_device *link)
 link-io.NumPorts1 = 16;
 link-io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
 link-io.IOAddrLines = 4;
-link-irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
+link-irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT;
 link-irq.IRQInfo1 = IRQ_LEVEL_ID;
 link-irq.Handler = smc_interrupt;
 link-irq.Instance = dev;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index c3b6960..1f09bea 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -886,7 +886,7 @@ xirc2ps_config(struct pcmcia_device * link)
}
printk(KNOT_XIRC no ports available\n);
 } else {
-   link-irq.Attributes |= 

ipg: Kconfig whitepaces/tab damages

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1417862d7355f0b395d83f2884afd614b086695
Commit: d1417862d7355f0b395d83f2884afd614b086695
Parent: bbd82f956e0db6190b16a8a00d3ed5d979f488e8
Author: Francois Romieu [EMAIL PROTECTED]
AuthorDate: Sun Oct 21 12:19:27 2007 +0200
Committer:  Francois Romieu [EMAIL PROTECTED]
CommitDate: Sun Oct 28 18:21:15 2007 +0100

ipg: Kconfig whitepaces/tab damages

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Avuton Olrich [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
---
 drivers/net/Kconfig |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 9f7ec7d..72d3447 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -166,14 +166,14 @@ config NET_SB1000
  If you don't have this card, of course say N.
 
 config IP1000
-   tristate IP1000 Gigabit Ethernet support
-   depends on PCI  EXPERIMENTAL
+   tristate IP1000 Gigabit Ethernet support
+   depends on PCI  EXPERIMENTAL
select MII
-   ---help---
- This driver supports IP1000 gigabit Ethernet cards.
+   ---help---
+ This driver supports IP1000 gigabit Ethernet cards.
 
- To compile this driver as a module, choose M here: the module
- will be called ipg.  This is recommended.
+ To compile this driver as a module, choose M here: the module
+ will be called ipg.  This is recommended.
 
 source drivers/net/arcnet/Kconfig
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipg: missing Kconfig dependency

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bbd82f956e0db6190b16a8a00d3ed5d979f488e8
Commit: bbd82f956e0db6190b16a8a00d3ed5d979f488e8
Parent: 93dd79e87bbc98ef02610d54fe72d4a1931ee15e
Author: Francois Romieu [EMAIL PROTECTED]
AuthorDate: Sun Oct 21 12:17:51 2007 +0200
Committer:  Francois Romieu [EMAIL PROTECTED]
CommitDate: Sun Oct 28 18:21:10 2007 +0100

ipg: missing Kconfig dependency

Fix for the error below while linking vmlinux:
[...]
drivers/built-in.o: In function `ipg_ioctl':
drivers/net/ipg.c:2148: undefined reference to `generic_mii_ioctl'
drivers/built-in.o: In function `ipg_get_settings':
drivers/net/ipg.c:2181: undefined reference to `mii_ethtool_gset'
drivers/built-in.o: In function `ipg_set_settings':
drivers/net/ipg.c:2193: undefined reference to `mii_ethtool_sset'
drivers/built-in.o: In function `ipg_nway_reset':
drivers/net/ipg.c:2205: undefined reference to `mii_nway_restart'
make: *** [.tmp_vmlinux1] Error 1

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Avuton Olrich [EMAIL PROTECTED]
Cc: Jesse Huang [EMAIL PROTECTED]
Cc: Sorbica Shieh [EMAIL PROTECTED]
---
 drivers/net/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 86b8641..9f7ec7d 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -168,6 +168,7 @@ config NET_SB1000
 config IP1000
tristate IP1000 Gigabit Ethernet support
depends on PCI  EXPERIMENTAL
+   select MII
---help---
  This driver supports IP1000 gigabit Ethernet cards.
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


r8169: remove poll_locked logic

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=93dd79e87bbc98ef02610d54fe72d4a1931ee15e
Commit: 93dd79e87bbc98ef02610d54fe72d4a1931ee15e
Parent: 7fab06c0ca89d99442a4baeddf417add585e2672
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Sun Oct 28 17:14:06 2007 +0100
Committer:  Francois Romieu [EMAIL PROTECTED]
CommitDate: Sun Oct 28 18:21:06 2007 +0100

r8169: remove poll_locked logic

Disabling napi polling early is well enough.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Edward Hsu [EMAIL PROTECTED]
---
 drivers/net/r8169.c |   12 
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index c5eaf49..b94fa7e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2991,13 +2991,16 @@ static void rtl8169_down(struct net_device *dev)
 {
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp-mmio_addr;
-   unsigned int poll_locked = 0;
unsigned int intrmask;
 
rtl8169_delete_timer(dev);
 
netif_stop_queue(dev);
 
+#ifdef CONFIG_R8169_NAPI
+   napi_disable(tp-napi);
+#endif
+
 core_down:
spin_lock_irq(tp-lock);
 
@@ -3011,13 +3014,6 @@ core_down:
 
synchronize_irq(dev-irq);
 
-   if (!poll_locked) {
-#ifdef CONFIG_R8169_NAPI
-   napi_disable(tp-napi);
-#endif
-   poll_locked++;
-   }
-
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_sched();  /* FIXME: should this be synchronize_irq()? */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


r8169: napi config

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7fab06c0ca89d99442a4baeddf417add585e2672
Commit: 7fab06c0ca89d99442a4baeddf417add585e2672
Parent: 96fd4cd3e40e240f0c385af87f58e74da8b7099a
Author: Stephen Hemminger [EMAIL PROTECTED]
AuthorDate: Sun Oct 28 17:10:08 2007 +0100
Committer:  Francois Romieu [EMAIL PROTECTED]
CommitDate: Sun Oct 28 18:21:01 2007 +0100

r8169: napi config

Don't call napi_disable if not configured and make sure that any
misuse of napi_xxx in future fails with a compile error.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
Cc: Edward Hsu [EMAIL PROTECTED]
---
 drivers/net/r8169.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index e8960f2..c5eaf49 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -392,7 +392,9 @@ struct rtl8169_private {
void __iomem *mmio_addr;/* memory map physical address */
struct pci_dev *pci_dev;/* Index of PCI device */
struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
struct napi_struct napi;
+#endif
spinlock_t lock;/* spin lock flag */
u32 msg_enable;
int chipset;
@@ -3010,7 +3012,9 @@ core_down:
synchronize_irq(dev-irq);
 
if (!poll_locked) {
+#ifdef CONFIG_R8169_NAPI
napi_disable(tp-napi);
+#endif
poll_locked++;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iwl4965: fix scan problem

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=948c171cfe9c63102cfb530af8a4b64e9643dde9
Commit: 948c171cfe9c63102cfb530af8a4b64e9643dde9
Parent: 052c4b9f0a83a83f3fee735b57c5b1e4edc1da8c
Author: Mohamed Abbas [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 17:15:45 2007 +0800
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:15:43 2007 -0400

[PATCH] iwl4965: fix scan problem

This patch fixes the following problems for 4965:
1. Fix direct scan by make sure we set one_direct_scan only when the
   mac80211 ask for direct scan.
2. Fix mac_stop and mac_remove_interface calles, we make sure we cancel any
   scan and disassoc on these call.

Signed-off-by: Mohamed Abbas [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   32 +++---
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c 
b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 27b8569..d60adcb 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6966,7 +6966,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
memcpy(scan-direct_scan[0].ssid,
   priv-direct_ssid, priv-direct_ssid_len);
direct_mask = 1;
-   } else if (!iwl_is_associated(priv)) {
+   } else if (!iwl_is_associated(priv)  priv-essid_len) {
scan-direct_scan[0].id = WLAN_EID_SSID;
scan-direct_scan[0].len = priv-essid_len;
memcpy(scan-direct_scan[0].ssid, priv-essid, priv-essid_len);
@@ -7119,6 +7119,10 @@ static void iwl_bg_post_associate(struct work_struct 
*data)
 
mutex_lock(priv-mutex);
 
+   if (!priv-interface_id || !priv-is_open) {
+   mutex_unlock(priv-mutex);
+   return;
+   }
iwl_scan_cancel_timeout(priv, 200);
 
conf = ieee80211_get_hw_conf(priv-hw);
@@ -7274,9 +7278,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
struct iwl_priv *priv = hw-priv;
 
IWL_DEBUG_MAC80211(enter\n);
+
+
+   mutex_lock(priv-mutex);
+   /* stop mac, cancel any scan request and clear
+* RXON_FILTER_ASSOC_MSK BIT
+*/
priv-is_open = 0;
-   /*netif_stop_queue(dev); */
-   flush_workqueue(priv-workqueue);
+   iwl_scan_cancel_timeout(priv, 100);
+   cancel_delayed_work(priv-post_associate);
+   priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
+   iwl_commit_rxon(priv);
+   mutex_unlock(priv-mutex);
+
IWL_DEBUG_MAC80211(leave\n);
 }
 
@@ -7623,6 +7637,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw 
*hw,
IWL_DEBUG_MAC80211(enter\n);
 
mutex_lock(priv-mutex);
+
+   iwl_scan_cancel_timeout(priv, 100);
+   cancel_delayed_work(priv-post_associate);
+   priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
+   iwl_commit_rxon(priv);
+
if (priv-interface_id == conf-if_id) {
priv-interface_id = 0;
memset(priv-bssid, 0, ETH_ALEN);
@@ -7675,7 +7695,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
priv-direct_ssid_len = (u8)
min((u8) len, (u8) IW_ESSID_MAX_SIZE);
memcpy(priv-direct_ssid, ssid, priv-direct_ssid_len);
-   }
+   } else
+   priv-one_direct_scan = 0;
 
rc = iwl_scan_initiate(priv);
 
@@ -9168,6 +9189,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
iwl_rate_control_unregister(priv-hw);
}
 
+   /*netif_stop_queue(dev); */
+   flush_workqueue(priv-workqueue);
+
/* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
 * priv-workqueue... so we can't take down the workqueue
 * until now... */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iwlwifi: fix sending probe request in iwl 4965

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=702004b7455e0c4dcf875dd2f638d611892ea84f
Commit: 702004b7455e0c4dcf875dd2f638d611892ea84f
Parent: 2fe142636b079c8facba49f80e3c311e58130e6b
Author: Tomas Winkler [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 17:15:33 2007 +0800
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:15:42 2007 -0400

[PATCH] iwlwifi: fix sending probe request in iwl 4965

This patch removeis TSF flag from probe request. TSF should be added only to
probe response.

Signed-off-by: Helmut Schaa [EMAIL PROTECTED]
Signed-off-by: Tomas Winkler [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 557deeb..4073367 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3232,9 +3232,7 @@ int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd 
*out_cmd,
tx-rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[rate_index].plcp,
rate_flags);
 
-   if (ieee80211_is_probe_request(fc))
-   tx-tx_flags |= TX_CMD_FLG_TSF_MSK;
-   else if (ieee80211_is_back_request(fc))
+   if (ieee80211_is_back_request(fc))
tx-tx_flags |= TX_CMD_FLG_ACK_MSK |
TX_CMD_FLG_IMM_BA_RSP_MASK;
 #ifdef CONFIG_IWLWIFI_HT
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rtl8187: Allow multicast frames

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2fe142636b079c8facba49f80e3c311e58130e6b
Commit: 2fe142636b079c8facba49f80e3c311e58130e6b
Parent: 82cd682d56e2a6bbb46d31076cdd9a62c667a2b4
Author: Michael Wu [EMAIL PROTECTED]
AuthorDate: Sat Oct 20 20:05:31 2007 -0400
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:06:29 2007 -0400

[PATCH] rtl8187: Allow multicast frames

This patch allows rtl8187 to receive multicast frames if requested.

Signed-off-by: Michael Wu [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rtl8187_dev.c |   20 +++-
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/rtl8187_dev.c 
b/drivers/net/wireless/rtl8187_dev.c
index de61c8f..e454ae8 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -433,6 +433,9 @@ static int rtl8187_start(struct ieee80211_hw *dev)
 
rtl818x_iowrite16(priv, priv-map-INT_MASK, 0x);
 
+   rtl818x_iowrite32(priv, priv-map-MAR[0], ~0);
+   rtl818x_iowrite32(priv, priv-map-MAR[1], ~0);
+
rtl8187_init_urbs(dev);
 
reg = RTL818X_RX_CONF_ONLYERLPKT |
@@ -582,32 +585,31 @@ static int rtl8187_config_interface(struct ieee80211_hw 
*dev, int if_id,
 static void rtl8187_configure_filter(struct ieee80211_hw *dev,
 unsigned int changed_flags,
 unsigned int *total_flags,
-int mc_count, struct dev_addr_list 
*mc_list)
+int mc_count, struct dev_addr_list *mclist)
 {
struct rtl8187_priv *priv = dev-priv;
 
-   *total_flags = 0;
-
-   if (changed_flags  FIF_ALLMULTI)
-   priv-rx_conf ^= RTL818X_RX_CONF_MULTICAST;
if (changed_flags  FIF_FCSFAIL)
priv-rx_conf ^= RTL818X_RX_CONF_FCS;
if (changed_flags  FIF_CONTROL)
priv-rx_conf ^= RTL818X_RX_CONF_CTRL;
if (changed_flags  FIF_OTHER_BSS)
priv-rx_conf ^= RTL818X_RX_CONF_MONITOR;
-
-   if (mc_count  0)
+   if (*total_flags  FIF_ALLMULTI || mc_count  0)
priv-rx_conf |= RTL818X_RX_CONF_MULTICAST;
+   else
+   priv-rx_conf = ~RTL818X_RX_CONF_MULTICAST;
+
+   *total_flags = 0;
 
-   if (priv-rx_conf  RTL818X_RX_CONF_MULTICAST)
-   *total_flags |= FIF_ALLMULTI;
if (priv-rx_conf  RTL818X_RX_CONF_FCS)
*total_flags |= FIF_FCSFAIL;
if (priv-rx_conf  RTL818X_RX_CONF_CTRL)
*total_flags |= FIF_CONTROL;
if (priv-rx_conf  RTL818X_RX_CONF_MONITOR)
*total_flags |= FIF_OTHER_BSS;
+   if (priv-rx_conf  RTL818X_RX_CONF_MULTICAST)
+   *total_flags |= FIF_ALLMULTI;
 
rtl818x_iowrite32_async(priv, priv-map-RX_CONF, priv-rx_conf);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] b43/b43legacy: jiffies_round - jiffies_round_relative

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82cd682d56e2a6bbb46d31076cdd9a62c667a2b4
Commit: 82cd682d56e2a6bbb46d31076cdd9a62c667a2b4
Parent: b239bd759869a82bbb8ecf94ff10634b6829313d
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Mon Oct 15 00:42:23 2007 -0500
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:05:36 2007 -0400

[PATCH] b43/b43legacy: jiffies_round - jiffies_round_relative

When rounding a relative timeout we need to use round_jiffies_relative().

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/b43/main.c   |2 +-
 drivers/net/wireless/b43legacy/main.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 9d9ff76..5058e60 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -2391,7 +2391,7 @@ out_requeue:
if (b43_debug(dev, B43_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
-   delay = round_jiffies(HZ * 15);
+   delay = round_jiffies_relative(HZ * 15);
queue_delayed_work(wl-hw-workqueue, dev-periodic_work, delay);
 out:
mutex_unlock(wl-mutex);
diff --git a/drivers/net/wireless/b43legacy/main.c 
b/drivers/net/wireless/b43legacy/main.c
index d09479e..f0e56df 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2260,7 +2260,7 @@ out_requeue:
if (b43legacy_debug(dev, B43legacy_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
-   delay = round_jiffies(HZ);
+   delay = round_jiffies_relative(HZ);
queue_delayed_work(dev-wl-hw-workqueue,
   dev-periodic_work, delay);
 out:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] rt2x00: jiffies_round - jiffies_round_relative

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b239bd759869a82bbb8ecf94ff10634b6829313d
Commit: b239bd759869a82bbb8ecf94ff10634b6829313d
Parent: be84e3d673ed32353e5504313dd1a5f5cc2f6ba6
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Mon Oct 15 00:40:34 2007 -0500
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:05:36 2007 -0400

[PATCH] rt2x00: jiffies_round - jiffies_round_relative

When rounding a relative timeout we need to use round_jiffies_relative().

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/rt2x00/rt2x00lib.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h 
b/drivers/net/wireless/rt2x00/rt2x00lib.h
index 298faa9..06d9bc0 100644
--- a/drivers/net/wireless/rt2x00/rt2x00lib.h
+++ b/drivers/net/wireless/rt2x00/rt2x00lib.h
@@ -30,7 +30,7 @@
  * Interval defines
  * Both the link tuner as the rfkill will be called once per second.
  */
-#define LINK_TUNE_INTERVAL ( round_jiffies(HZ) )
+#define LINK_TUNE_INTERVAL ( round_jiffies_relative(HZ) )
 #define RFKILL_POLL_INTERVAL   ( 1000 )
 
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ipw2100/ipw2200: jiffies_round - jiffies_round_relative

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be84e3d673ed32353e5504313dd1a5f5cc2f6ba6
Commit: be84e3d673ed32353e5504313dd1a5f5cc2f6ba6
Parent: c9927c2bf4f45bb85e8b502ab3fb79ad6483c244
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Mon Oct 15 00:38:01 2007 -0500
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:05:35 2007 -0400

[PATCH] ipw2100/ipw2200: jiffies_round - jiffies_round_relative

When rounding a relative timeout we need to use round_jiffies_relative().

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |   11 ++-
 drivers/net/wireless/ipw2200.c |6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a6c7904..8d53d08 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1769,7 +1769,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int 
deferred)
if (priv-stop_rf_kill) {
priv-stop_rf_kill = 0;
queue_delayed_work(priv-workqueue, priv-rf_kill,
-  round_jiffies(HZ));
+  round_jiffies_relative(HZ));
}
 
deferred = 1;
@@ -2086,7 +2086,8 @@ static void isr_indicate_rf_kill(struct ipw2100_priv 
*priv, u32 status)
/* Make sure the RF Kill check timer is running */
priv-stop_rf_kill = 0;
cancel_delayed_work(priv-rf_kill);
-   queue_delayed_work(priv-workqueue, priv-rf_kill, round_jiffies(HZ));
+   queue_delayed_work(priv-workqueue, priv-rf_kill,
+  round_jiffies_relative(HZ));
 }
 
 static void send_scan_event(void *data)
@@ -2123,7 +2124,7 @@ static void isr_scan_complete(struct ipw2100_priv *priv, 
u32 status)
if (!delayed_work_pending(priv-scan_event_later))
queue_delayed_work(priv-workqueue,
priv-scan_event_later,
-   round_jiffies(msecs_to_jiffies(4000)));
+   
round_jiffies_relative(msecs_to_jiffies(4000)));
} else {
priv-user_requested_scan = 0;
cancel_delayed_work(priv-scan_event_later);
@@ -4242,7 +4243,7 @@ static int ipw_radio_kill_sw(struct ipw2100_priv *priv, 
int disable_radio)
priv-stop_rf_kill = 0;
cancel_delayed_work(priv-rf_kill);
queue_delayed_work(priv-workqueue, priv-rf_kill,
-  round_jiffies(HZ));
+  round_jiffies_relative(HZ));
} else
schedule_reset(priv);
}
@@ -5981,7 +5982,7 @@ static void ipw2100_rf_kill(struct work_struct *work)
IPW_DEBUG_RF_KILL(RF Kill active, rescheduling GPIO check\n);
if (!priv-stop_rf_kill)
queue_delayed_work(priv-workqueue, priv-rf_kill,
-  round_jiffies(HZ));
+  round_jiffies_relative(HZ));
goto exit_unlock;
}
 
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index e3c8284..54f44e5 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1753,7 +1753,7 @@ static int ipw_radio_kill_sw(struct ipw_priv *priv, int 
disable_radio)
/* Make sure the RF_KILL check timer is running */
cancel_delayed_work(priv-rf_kill);
queue_delayed_work(priv-workqueue, priv-rf_kill,
-  round_jiffies(2 * HZ));
+  round_jiffies_relative(2 * HZ));
} else
queue_work(priv-workqueue, priv-up);
}
@@ -4364,7 +4364,7 @@ static void handle_scan_event(struct ipw_priv *priv)
if (!priv-user_requested_scan) {
if (!delayed_work_pending(priv-scan_event))
queue_delayed_work(priv-workqueue, priv-scan_event,
-round_jiffies(msecs_to_jiffies(4000)));
+
round_jiffies_relative(msecs_to_jiffies(4000)));
} else {
union iwreq_data wrqu;
 
@@ -4728,7 +4728,7 @@ static void ipw_rx_notification(struct ipw_priv *priv,
  priv-status  STATUS_ASSOCIATED)
queue_delayed_work(priv-workqueue,
   priv-request_scan,
-  round_jiffies(HZ));
+  

e1000e: Remove legacy jumbo frame receive code

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f920c186be09718542dfa77f6ebe1814be7d35cb
Commit: f920c186be09718542dfa77f6ebe1814be7d35cb
Parent: 140a74802894e9db57e5cd77ccff77e590ece5f3
Author: Auke Kok [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 13:58:03 2007 -0700
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:47:08 2007 -0400

e1000e: Remove legacy jumbo frame receive code

The legacy jumbo frame receive code is no longer needed since all
hardware can do packet split and we're no longer offering a bypass
kernel config option to disable packet split. Remove the unused code.

Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/e1000e/e1000.h  |1 -
 drivers/net/e1000e/netdev.c |  282 +--
 2 files changed, 1 insertions(+), 282 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index 811eada..473f78d 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -122,7 +122,6 @@ struct e1000_buffer {
u16 next_to_watch;
};
/* RX */
-   struct page *page;
/* arrays of page information for packet split */
struct e1000_ps_page *ps_pages;
};
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 03fcc70..4fd2e23 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -333,94 +333,6 @@ no_buffers:
 }
 
 /**
- * e1000_alloc_rx_buffers_jumbo - Replace used jumbo receive buffers
- *
- * @adapter: address of board private structure
- * @cleaned_count: number of buffers to allocate this pass
- **/
-static void e1000_alloc_rx_buffers_jumbo(struct e1000_adapter *adapter,
-int cleaned_count)
-{
-   struct net_device *netdev = adapter-netdev;
-   struct pci_dev *pdev = adapter-pdev;
-   struct e1000_ring *rx_ring = adapter-rx_ring;
-   struct e1000_rx_desc *rx_desc;
-   struct e1000_buffer *buffer_info;
-   struct sk_buff *skb;
-   unsigned int i;
-   unsigned int bufsz = 256 -
-16 /*for skb_reserve */ -
-NET_IP_ALIGN;
-
-   i = rx_ring-next_to_use;
-   buffer_info = rx_ring-buffer_info[i];
-
-   while (cleaned_count--) {
-   skb = buffer_info-skb;
-   if (skb) {
-   skb_trim(skb, 0);
-   goto check_page;
-   }
-
-   skb = netdev_alloc_skb(netdev, bufsz);
-   if (!skb) {
-   /* Better luck next round */
-   adapter-alloc_rx_buff_failed++;
-   break;
-   }
-
-   /* Make buffer alignment 2 beyond a 16 byte boundary
-* this will result in a 16 byte aligned IP header after
-* the 14 byte MAC header is removed
-*/
-   skb_reserve(skb, NET_IP_ALIGN);
-
-   buffer_info-skb = skb;
-check_page:
-   /* allocate a new page if necessary */
-   if (!buffer_info-page) {
-   buffer_info-page = alloc_page(GFP_ATOMIC);
-   if (!buffer_info-page) {
-   adapter-alloc_rx_buff_failed++;
-   break;
-   }
-   }
-
-   if (!buffer_info-dma)
-   buffer_info-dma = pci_map_page(pdev,
-   buffer_info-page, 0,
-   PAGE_SIZE,
-   PCI_DMA_FROMDEVICE);
-   if (pci_dma_mapping_error(buffer_info-dma)) {
-   dev_err(adapter-pdev-dev, RX DMA page map 
failed\n);
-   adapter-rx_dma_failed++;
-   break;
-   }
-
-   rx_desc = E1000_RX_DESC(*rx_ring, i);
-   rx_desc-buffer_addr = cpu_to_le64(buffer_info-dma);
-
-   i++;
-   if (i == rx_ring-count)
-   i = 0;
-   buffer_info = rx_ring-buffer_info[i];
-   }
-
-   if (rx_ring-next_to_use != i) {
-   rx_ring-next_to_use = i;
-   if (i-- == 0)
-   i = (rx_ring-count - 1);
-
-   /* Force memory writes to complete before letting h/w
-* know there are new descriptors to fetch.  (Only
-* applicable for weak-ordered memory model archs,
-* such as IA-64). */
-   wmb();
-   writel(i, adapter-hw.hw_addr + rx_ring-tail);
-   }
-}
-
-/**
  * e1000_clean_rx_irq - Send received data up the network stack; legacy
  * 

e1000e: Re-enable SECRC - crc stripping

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=140a74802894e9db57e5cd77ccff77e590ece5f3
Commit: 140a74802894e9db57e5cd77ccff77e590ece5f3
Parent: df762464ad0fad721f9fc5724e85b3df0d550acd
Author: Auke Kok [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 13:57:58 2007 -0700
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:47:08 2007 -0400

e1000e: Re-enable SECRC - crc stripping

This workaround code performed software stripping instead of the
hardware which can do it much faster. None of the e1000e target
hardware has issues with this feature and should work fine. This
gives us some performance back on receive, and removes some
kludging stripping the 4 bytes.

Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/e1000e/netdev.c |   19 ++-
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index e87ed31..03fcc70 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -494,10 +494,6 @@ static bool e1000_clean_rx_irq(struct e1000_adapter 
*adapter,
goto next_desc;
}
 
-   /* adjust length to remove Ethernet CRC */
-   length -= 4;
-
-   /* probably a little skewed due to removing CRC */
total_rx_bytes += length;
total_rx_packets++;
 
@@ -964,8 +960,7 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter 
*adapter,
kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
pci_dma_sync_single_for_device(pdev, ps_page-dma,
PAGE_SIZE, PCI_DMA_FROMDEVICE);
-   /* remove the CRC */
-   l1 -= 4;
+
skb_put(skb, l1);
goto copydone;
} /* if */
@@ -987,10 +982,6 @@ static bool e1000_clean_rx_irq_ps(struct e1000_adapter 
*adapter,
skb-truesize += length;
}
 
-   /* strip the ethernet crc, problem is we're using pages now so
-* this whole operation can get a little cpu intensive */
-   pskb_trim(skb, skb-len - 4);
-
 copydone:
total_rx_bytes += skb-len;
total_rx_packets++;
@@ -2034,9 +2025,11 @@ static void e1000_setup_rctl(struct e1000_adapter 
*adapter)
 
ew32(RFCTL, rfctl);
 
-   /* disable the stripping of CRC because it breaks
-* BMC firmware connected over SMBUS */
-   rctl |= E1000_RCTL_DTYP_PS /* | E1000_RCTL_SECRC */;
+   /* Enable Packet split descriptors */
+   rctl |= E1000_RCTL_DTYP_PS;
+   
+   /* Enable hardware CRC frame stripping */
+   rctl |= E1000_RCTL_SECRC;
 
psrctl |= adapter-rx_ps_bsize0 
E1000_PSRCTL_BSIZE0_SHIFT;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


drivers/net/irda/au1k_ir: fix obvious irq handler bugs

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e38c2c651a038b78fd01cf2e3f3a65cacf0e41cc
Commit: e38c2c651a038b78fd01cf2e3f3a65cacf0e41cc
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:18:12 2007 -0400
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:42:18 2007 -0400

drivers/net/irda/au1k_ir: fix obvious irq handler bugs

interrupt handlers return a return value these days.

Also, kill always-true test and unneeded void* cast.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/irda/au1k_ir.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/net/irda/au1k_ir.c b/drivers/net/irda/au1k_ir.c
index 4dbdfaa..a1e4508 100644
--- a/drivers/net/irda/au1k_ir.c
+++ b/drivers/net/irda/au1k_ir.c
@@ -627,19 +627,16 @@ static int au1k_irda_rx(struct net_device *dev)
 }
 
 
-void au1k_irda_interrupt(int irq, void *dev_id)
+static irqreturn_t au1k_irda_interrupt(int dummy, void *dev_id)
 {
-   struct net_device *dev = (struct net_device *) dev_id;
-
-   if (dev == NULL) {
-   printk(KERN_ERR %s: isr: null dev ptr\n, dev-name);
-   return;
-   }
+   struct net_device *dev = dev_id;
 
writel(0, IR_INT_CLEAR); /* ack irda interrupts */
 
au1k_irda_rx(dev);
au1k_tx_ack(dev);
+
+   return IRQ_HANDLED;
 }
 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ISDN] capidrv: address two longstanding warnings

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b393243fe7b711eb18eafaaf469bdb39317adf5b
Commit: b393243fe7b711eb18eafaaf469bdb39317adf5b
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Jeff Garzik [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 23:02:14 2007 -0400
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 04:45:06 2007 -0400

[ISDN] capidrv: address two longstanding warnings

* change #warning to a code comment

* add comment and special ifdef'd 64-bit code for a situation where
  we must store a pointer into a CAPI field 'Data', which is fixed by
  the interface at 32 bits.

Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
Acked-by: Karsten Keil [EMAIL PROTECTED]
---
 drivers/isdn/capi/capidrv.c |   25 +++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c
index 476012b..48c1775 100644
--- a/drivers/isdn/capi/capidrv.c
+++ b/drivers/isdn/capi/capidrv.c
@@ -1843,6 +1843,7 @@ static int if_sendbuf(int id, int channel, int doack, 
struct sk_buff *skb)
int msglen;
u16 errcode;
u16 datahandle;
+   u32 data;
 
if (!card) {
printk(KERN_ERR capidrv: if_sendbuf called with invalid 
driverId %d!\n,
@@ -1860,9 +1861,26 @@ static int if_sendbuf(int id, int channel, int doack, 
struct sk_buff *skb)
return 0;
}
datahandle = nccip-datahandle;
+
+   /*
+* Here we copy pointer skb-data into the 32-bit 'Data' field.
+* The 'Data' field is not used in practice in linux kernel
+* (neither in 32 or 64 bit), but should have some value,
+* since a CAPI message trace will display it.
+*
+* The correct value in the 32 bit case is the address of the
+* data, in 64 bit it makes no sense, we use 0 there.
+*/
+
+#ifdef CONFIG_64BIT
+   data = 0;
+#else
+   data = (unsigned long) skb-data;
+#endif
+
capi_fill_DATA_B3_REQ(sendcmsg, global.ap.applid, card-msgid++,
  nccip-ncci,  /* adr */
- (u32) skb-data,  /* Data */
+ data, /* Data */
  skb-len, /* DataLength */
  datahandle,   /* DataHandle */
  0 /* Flags */
@@ -2123,7 +2141,10 @@ static int capidrv_delcontr(u16 contr)
printk(KERN_ERR capidrv: delcontr: no contr %u\n, contr);
return -1;
}
-   #warning FIXME: maybe a race condition the card should be removed here 
from global list /kkeil
+
+   /* FIXME: maybe a race condition the card should be removed
+* here from global list /kkeil
+*/
spin_unlock_irqrestore(global_lock, flags);
 
del_timer(card-listentimer);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


block: use lock bitops for the tag map.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adb4ddbbfb90c302e78da68b3f015588ca45d7f3
Commit: adb4ddbbfb90c302e78da68b3f015588ca45d7f3
Parent: bd4f36d6da175ed51840fe07b8906951c4dea609
Author: Nick Piggin [EMAIL PROTECTED]
AuthorDate: Wed Oct 24 10:54:38 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:06 2007 +0100

block: use lock bitops for the tag map.

The block queue tag map can use lock bitops.

Signed-off-by: Nick Piggin [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/ll_rw_blk.c |   20 +---
 1 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index d8616e6..a8a1810 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1057,18 +1057,16 @@ void blk_queue_end_tag(struct request_queue *q, struct 
request *rq)
 
bqt-tag_index[tag] = NULL;
 
-   /*
-* We use test_and_clear_bit's memory ordering properties here.
-* The tag_map bit acts as a lock for tag_index[bit], so we need
-* a barrer before clearing the bit (precisely: release semantics).
-* Could use clear_bit_unlock when it is merged.
-*/
-   if (unlikely(!test_and_clear_bit(tag, bqt-tag_map))) {
+   if (unlikely(!test_bit(tag, bqt-tag_map))) {
printk(KERN_ERR %s: attempt to clear non-busy tag (%d)\n,
   __FUNCTION__, tag);
return;
}
-
+   /*
+* The tag_map bit acts as a lock for tag_index[bit], so we need
+* unlock memory barrier semantics.
+*/
+   clear_bit_unlock(tag, bqt-tag_map);
bqt-busy--;
 }
 
@@ -1114,10 +1112,10 @@ int blk_queue_start_tag(struct request_queue *q, struct 
request *rq)
if (tag = bqt-max_depth)
return 1;
 
-   } while (test_and_set_bit(tag, bqt-tag_map));
+   } while (test_and_set_bit_lock(tag, bqt-tag_map));
/*
-* We rely on test_and_set_bit providing lock memory ordering semantics
-* (could use test_and_set_bit_lock when it is merged).
+* We need lock ordering semantics given by test_and_set_bit_lock.
+* See blk_queue_end_tag for details.
 */
 
rq-cmd_flags |= REQ_QUEUED;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cfq_exit_queue() should cancel cfq_data-unplug_work

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4310864b9d17714e64446bfb8bc7dbcb96454475
Commit: 4310864b9d17714e64446bfb8bc7dbcb96454475
Parent: b238b3d4be04d3acf1f86ff8ad0b0e803def67ff
Author: Oleg Nesterov [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 15:08:18 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:05 2007 +0100

cfq_exit_queue() should cancel cfq_data-unplug_work

Spotted by Nick [EMAIL PROTECTED], perhaps explains the first trace in
http://bugzilla.kernel.org/show_bug.cgi?id=9180.

cfq_exit_queue() should cancel cfqd-unplug_work before freeing cfqd.
blk_sync_queue() seems unneeded, removed.

Q: why cfq_exit_queue() calls cfq_shutdown_timer_wq() twice?

Signed-off-by: Oleg Nesterov [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/cfq-iosched.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index 54dc054..d77c971 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -2053,7 +2053,7 @@ static void cfq_shutdown_timer_wq(struct cfq_data *cfqd)
 {
del_timer_sync(cfqd-idle_slice_timer);
del_timer_sync(cfqd-idle_class_timer);
-   blk_sync_queue(cfqd-queue);
+   kblockd_flush_work(cfqd-unplug_work);
 }
 
 static void cfq_put_async_queues(struct cfq_data *cfqd)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


block layer: remove a unused argument of drive_stat_acct()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b238b3d4be04d3acf1f86ff8ad0b0e803def67ff
Commit: b238b3d4be04d3acf1f86ff8ad0b0e803def67ff
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Jerome Marchand [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 15:05:46 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:05 2007 +0100

block layer: remove a unused argument of drive_stat_acct()

The nr_sector argument of drive_stat_acct() is not used anymore since the 
read and write sectors statistics are now updated in end_that_request_first(). 
This patch removes the useless argument.

Signed-off-by: Jerome Marchand [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/ll_rw_blk.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index b01dee3..49c0f18 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -39,7 +39,7 @@
 
 static void blk_unplug_work(struct work_struct *work);
 static void blk_unplug_timeout(unsigned long data);
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io);
+static void drive_stat_acct(struct request *rq, int new_io);
 static void init_request_from_bio(struct request *req, struct bio *bio);
 static int __make_request(struct request_queue *q, struct bio *bio);
 static struct io_context *current_io_context(gfp_t gfp_flags, int node);
@@ -2341,7 +2341,7 @@ void blk_insert_request(struct request_queue *q, struct 
request *rq,
if (blk_rq_tagged(rq))
blk_queue_end_tag(q, rq);
 
-   drive_stat_acct(rq, rq-nr_sectors, 1);
+   drive_stat_acct(rq, 1);
__elv_add_request(q, rq, where, 0);
blk_start_queueing(q);
spin_unlock_irqrestore(q-queue_lock, flags);
@@ -2736,7 +2736,7 @@ int blkdev_issue_flush(struct block_device *bdev, 
sector_t *error_sector)
 
 EXPORT_SYMBOL(blkdev_issue_flush);
 
-static void drive_stat_acct(struct request *rq, int nr_sectors, int new_io)
+static void drive_stat_acct(struct request *rq, int new_io)
 {
int rw = rq_data_dir(rq);
 
@@ -2758,7 +2758,7 @@ static void drive_stat_acct(struct request *rq, int 
nr_sectors, int new_io)
  */
 static inline void add_request(struct request_queue * q, struct request * req)
 {
-   drive_stat_acct(req, req-nr_sectors, 1);
+   drive_stat_acct(req, 1);
 
/*
 * elevator indicated where it wants this request to be
@@ -3015,7 +3015,7 @@ static int __make_request(struct request_queue *q, struct 
bio *bio)
req-biotail = bio;
req-nr_sectors = req-hard_nr_sectors += nr_sectors;
req-ioprio = ioprio_best(req-ioprio, prio);
-   drive_stat_acct(req, nr_sectors, 0);
+   drive_stat_acct(req, 0);
if (!attempt_back_merge(q, req))
elv_merged_request(q, req, el_ret);
goto out;
@@ -3042,7 +3042,7 @@ static int __make_request(struct request_queue *q, struct 
bio *bio)
req-sector = req-hard_sector = bio-bi_sector;
req-nr_sectors = req-hard_nr_sectors += nr_sectors;
req-ioprio = ioprio_best(req-ioprio, prio);
-   drive_stat_acct(req, nr_sectors, 0);
+   drive_stat_acct(req, 0);
if (!attempt_front_merge(q, req))
elv_merged_request(q, req, el_ret);
goto out;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sg_init_table() should use unsigned loop index variable

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=513f54b78f9594927ede66b6c66a70c1bae0c4ca
Commit: 513f54b78f9594927ede66b6c66a70c1bae0c4ca
Parent: 74eb94f7b84f4e631a0e020991fb16f17ce85ab7
Author: Chuck Lever [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 19:29:48 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:04 2007 +0100

sg_init_table() should use unsigned loop index variable

Clean up: fix a mixed sign comparison in sg_init_table() accidentally
introduced by commit d6ec0842.  The sign of the loop index variable
should match the sign of the nents argument.

Signed-off-by: Chuck Lever [EMAIL PROTECTED]
Cc: Jens Axboe [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 include/linux/scatterlist.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 19b751a..32326c2 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -243,7 +243,7 @@ static inline void sg_init_table(struct scatterlist *sgl, 
unsigned int nents)
sg_mark_end(sgl, nents);
 #ifdef CONFIG_DEBUG_SG
{
-   int i;
+   unsigned int i;
for (i = 0; i  nents; i++)
sgl[i].sg_magic = SG_MAGIC;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Initialise scatter/gather list in ata_sg_setup

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=acd054a5ef401e03e0047b487e572442614f81e5
Commit: acd054a5ef401e03e0047b487e572442614f81e5
Parent: 5336940dd8b11180a0340ba886db62f728377d19
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:59:44 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:03 2007 +0100

Initialise scatter/gather list in ata_sg_setup

After turning on DEBUG_SG I hit a fail:

kernel BUG at include/linux/scatterlist.h:50!

ata_qc_issue
ata_scsi_translate
ipr_queuecommand
scsi_dispatch_cmd
scsi_request_fn
elv_insert
blk_execute_rq_nowait
blk_execute_rq
sg_io
scsi_cmd_ioctl
cdrom_ioctl
sr_block_ioctl
blkdev_driver_ioctl
blkdev_ioctl
block_ioctl
do_ioctl
vfs_ioctl
sys_ioctl
sg_ioctl_trans

It looks like ata_sg_setup is working on an uninitialised sg table. Call
sg_init_table to initialise it before use.

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]

Note: this patch will fix it, but you could also get away with just
doing the sg_init_table() once at qc creation time.

Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 081e3df..7ef515b 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4689,6 +4689,7 @@ static int ata_sg_setup(struct ata_queued_cmd *qc)
 * data in this function or read data in ata_sg_clean.
 */
offset = lsg-offset + lsg-length - qc-pad_len;
+   sg_init_table(psg, 1);
sg_set_page(psg, nth_page(sg_page(lsg), offset  PAGE_SHIFT),
qc-pad_len, offset_in_page(offset));
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SG: clear termination bit in sg_chain()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73fd546aa75e9db02526bf304d4f736c4ec82b4b
Commit: 73fd546aa75e9db02526bf304d4f736c4ec82b4b
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Jens Axboe [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 09:32:16 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:03 2007 +0100

SG: clear termination bit in sg_chain()

Since we are using the last entry in the list, clear any possible
termination bit that may have already been set. Pointed out by Rusty.

Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 include/linux/scatterlist.h |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 4571231..b2ec842 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -179,7 +179,11 @@ static inline void sg_chain(struct scatterlist *prv, 
unsigned int prv_nents,
 #ifndef ARCH_HAS_SG_CHAIN
BUG();
 #endif
-   prv[prv_nents - 1].page_link = (unsigned long) sgl | 0x01;
+   /*
+* Set lowest bit to indicate a link pointer, and make sure to clear
+* the termination bit if it happens to be set.
+*/
+   prv[prv_nents - 1].page_link = ((unsigned long) sgl | 0x01)  ~0x02;
 }
 
 /**
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Quieten hrtimer printk: Switched to high resolution mode ..

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=edfed66e17854c312e81a2218f9b0592a555c9a3
Commit: edfed66e17854c312e81a2218f9b0592a555c9a3
Parent: 129f1d2c5352eea3f7c8af9f8c1006dc0da7be52
Author: Michael Ellerman [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 16:35:29 2007 +1100
Committer:  Thomas Gleixner [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:39:38 2007 +0100

Quieten hrtimer printk: Switched to high resolution mode ..

Change the hrtimer printk Switched to high resolution mode .. to
be KERN_DEBUG, rather than KERN_INFO. If users need to see this they
can pass loglevel or debug on the command line, or check dmesg.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]

 kernel/hrtimer.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
 kernel/hrtimer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index b6d2ff7..22a2514 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -602,7 +602,7 @@ static int hrtimer_switch_to_hres(void)
/* Retrigger the interrupt to get things going */
retrigger_next_event(NULL);
local_irq_restore(flags);
-   printk(KERN_INFO Switched to high resolution mode on CPU %d\n,
+   printk(KERN_DEBUG Switched to high resolution mode on CPU %d\n,
   smp_processor_id());
return 1;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SCTP endianness annotations regression

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d06f608265d5fc41aefe2fae5b62da4893ecae35
Commit: d06f608265d5fc41aefe2fae5b62da4893ecae35
Parent: 4fe05bbcd53160616774b6f5619b8a55bcfa1c57
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:03:23 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

SCTP endianness annotations regression

Signed-off-by: Al Viro [EMAIL PROTECTED]
Acked-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/net/sctp/auth.h |2 +-
 net/sctp/auth.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 9e8f13b..5db261a 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -103,7 +103,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct 
sctp_association *asoc);
 void sctp_auth_asoc_set_default_hmac(struct sctp_association *asoc,
 struct sctp_hmac_algo_param *hmacs);
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-   __u16 hmac_id);
+   __be16 hmac_id);
 int sctp_auth_send_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 int sctp_auth_recv_cid(sctp_cid_t chunk, const struct sctp_association *asoc);
 void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 8af1004..6d5fa6b 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -556,7 +556,7 @@ struct sctp_hmac *sctp_auth_asoc_get_hmac(const struct 
sctp_association *asoc)
return sctp_hmac_list[id];
 }
 
-static int __sctp_auth_find_hmacid(__u16 *hmacs, int n_elts, __u16 hmac_id)
+static int __sctp_auth_find_hmacid(__be16 *hmacs, int n_elts, __be16 hmac_id)
 {
int  found = 0;
int  i;
@@ -573,7 +573,7 @@ static int __sctp_auth_find_hmacid(__u16 *hmacs, int 
n_elts, __u16 hmac_id)
 
 /* See if the HMAC_ID is one that we claim as supported */
 int sctp_auth_asoc_verify_hmac_id(const struct sctp_association *asoc,
-   __u16 hmac_id)
+   __be16 hmac_id)
 {
struct sctp_hmac_algo_param *hmacs;
__u16 n_elt;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


misc uml annotation and section fixes

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b4a08a10b12c145da67cc788849bf7cc6efaa210
Commit: b4a08a10b12c145da67cc788849bf7cc6efaa210
Parent: 27bb628a1d759cc82ff6360becf61de601907811
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:36:10 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

misc uml annotation and section fixes

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/kernel/mem.c|2 +-
 arch/um/sys-i386/ptrace.c   |8 
 arch/um/sys-x86_64/ptrace.c |4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index 8456397..59822de 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -165,7 +165,7 @@ static void __init kmap_init(void)
kmap_prot = PAGE_KERNEL;
 }
 
-static void init_highmem(void)
+static void __init init_highmem(void)
 {
pgd_t *pgd;
pud_t *pud;
diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c
index 9657c89..bd3da8a 100644
--- a/arch/um/sys-i386/ptrace.c
+++ b/arch/um/sys-i386/ptrace.c
@@ -155,7 +155,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct 
task_struct *child)
if (err)
return err;
 
-   n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+   n = copy_to_user(buf, fpregs, sizeof(fpregs));
if(n  0)
return -EFAULT;
 
@@ -168,7 +168,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct 
task_struct *child)
long fpregs[HOST_FP_SIZE];
 
BUG_ON(sizeof(*buf) != sizeof(fpregs));
-   n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+   n = copy_from_user(fpregs, buf, sizeof(fpregs));
if (n  0)
return -EFAULT;
 
@@ -185,7 +185,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct 
task_struct *child)
if (err)
return err;
 
-   n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+   n = copy_to_user(buf, fpregs, sizeof(fpregs));
if(n  0)
return -EFAULT;
 
@@ -198,7 +198,7 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct 
task_struct *child)
long fpregs[HOST_XFP_SIZE];
 
BUG_ON(sizeof(*buf) != sizeof(fpregs));
-   n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+   n = copy_from_user(fpregs, buf, sizeof(fpregs));
if (n  0)
return -EFAULT;
 
diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c
index a3cfeed..b7631b0 100644
--- a/arch/um/sys-x86_64/ptrace.c
+++ b/arch/um/sys-x86_64/ptrace.c
@@ -154,7 +154,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct 
task_struct *child)
if (err)
return err;
 
-   n = copy_to_user((void *) buf, fpregs, sizeof(fpregs));
+   n = copy_to_user(buf, fpregs, sizeof(fpregs));
if(n  0)
return -EFAULT;
 
@@ -167,7 +167,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct 
task_struct *child)
long fpregs[HOST_FP_SIZE];
 
BUG_ON(sizeof(*buf) != sizeof(fpregs));
-   n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs));
+   n = copy_from_user(fpregs, buf, sizeof(fpregs));
if (n  0)
return -EFAULT;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


arcmsr: endianness bug

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a7d26d58a0f61cffddc8839067dfad10413b852
Commit: 6a7d26d58a0f61cffddc8839067dfad10413b852
Parent: 80da1adbbf8805bc1a5d287ab171463710b7d92e
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:08:48 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:33 2007 -0700

arcmsr: endianness bug

initializing a field in data shared with the card with
cpu_to_le32(something) | 0x10 is broken - the field is, indeed,
little-endian and we need cpu_to_le32() on both parts.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/arcmsr/arcmsr_hba.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index aaee028..4c1b3b4 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -916,7 +916,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock 
*acb,
 
pdma_sg-addresshigh = address_hi;
pdma_sg-address = address_lo;
-   pdma_sg-length = length|IS_SG64_ADDR;
+   pdma_sg-length = 
length|cpu_to_le32(IS_SG64_ADDR);
psge += sizeof (struct SG64ENTRY);
arccdbsize += sizeof (struct SG64ENTRY);
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


SUNRPC endianness annotations

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d8a972661832719931b0dd5b80e97215cb93d94
Commit: 2d8a972661832719931b0dd5b80e97215cb93d94
Parent: 7a78a1722380dd3cb5a009dbcd007f92b6b87743
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:37:58 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

SUNRPC endianness annotations

rpcrdma stuff lacks endianness annotations for on-the-wire data.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Acked-by: David S. Miller [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/sunrpc/rpc_rdma.h |   32 
 net/sunrpc/xprtrdma/rpc_rdma.c  |   24 
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/linux/sunrpc/rpc_rdma.h b/include/linux/sunrpc/rpc_rdma.h
index 0013a0d..87b895d 100644
--- a/include/linux/sunrpc/rpc_rdma.h
+++ b/include/linux/sunrpc/rpc_rdma.h
@@ -41,17 +41,17 @@
 #define _LINUX_SUNRPC_RPC_RDMA_H
 
 struct rpcrdma_segment {
-   uint32_t rs_handle; /* Registered memory handle */
-   uint32_t rs_length; /* Length of the chunk in bytes */
-   uint64_t rs_offset; /* Chunk virtual address or offset */
+   __be32 rs_handle;   /* Registered memory handle */
+   __be32 rs_length;   /* Length of the chunk in bytes */
+   __be64 rs_offset;   /* Chunk virtual address or offset */
 };
 
 /*
  * read chunk(s), encoded as a linked list.
  */
 struct rpcrdma_read_chunk {
-   uint32_t rc_discrim;/* 1 indicates presence */
-   uint32_t rc_position;   /* Position in XDR stream */
+   __be32 rc_discrim;  /* 1 indicates presence */
+   __be32 rc_position; /* Position in XDR stream */
struct rpcrdma_segment rc_target;
 };
 
@@ -66,29 +66,29 @@ struct rpcrdma_write_chunk {
  * write chunk(s), encoded as a counted array.
  */
 struct rpcrdma_write_array {
-   uint32_t wc_discrim;/* 1 indicates presence */
-   uint32_t wc_nchunks;/* Array count */
+   __be32 wc_discrim;  /* 1 indicates presence */
+   __be32 wc_nchunks;  /* Array count */
struct rpcrdma_write_chunk wc_array[0];
 };
 
 struct rpcrdma_msg {
-   uint32_t rm_xid;/* Mirrors the RPC header xid */
-   uint32_t rm_vers;   /* Version of this protocol */
-   uint32_t rm_credit; /* Buffers requested/granted */
-   uint32_t rm_type;   /* Type of message (enum rpcrdma_proc) */
+   __be32 rm_xid;  /* Mirrors the RPC header xid */
+   __be32 rm_vers; /* Version of this protocol */
+   __be32 rm_credit;   /* Buffers requested/granted */
+   __be32 rm_type; /* Type of message (enum rpcrdma_proc) */
union {
 
struct {/* no chunks */
-   uint32_t rm_empty[3];   /* 3 empty chunk lists */
+   __be32 rm_empty[3]; /* 3 empty chunk lists */
} rm_nochunks;
 
struct {/* no chunks and padded */
-   uint32_t rm_align;  /* Padding alignment */
-   uint32_t rm_thresh; /* Padding threshold */
-   uint32_t rm_pempty[3];  /* 3 empty chunk lists */
+   __be32 rm_align;/* Padding alignment */
+   __be32 rm_thresh;   /* Padding threshold */
+   __be32 rm_pempty[3];/* 3 empty chunk lists */
} rm_padded;
 
-   uint32_t rm_chunks[0];  /* read, write and reply chunks */
+   __be32 rm_chunks[0];/* read, write and reply chunks */
 
} rm_body;
 };
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
index 12db635..f877b88 100644
--- a/net/sunrpc/xprtrdma/rpc_rdma.c
+++ b/net/sunrpc/xprtrdma/rpc_rdma.c
@@ -181,7 +181,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf 
*target,
struct rpcrdma_read_chunk *cur_rchunk = NULL;
struct rpcrdma_write_array *warray = NULL;
struct rpcrdma_write_chunk *cur_wchunk = NULL;
-   u32 *iptr = headerp-rm_body.rm_chunks;
+   __be32 *iptr = headerp-rm_body.rm_chunks;
 
if (type == rpcrdma_readch || type == rpcrdma_areadch) {
/* a read chunk - server will RDMA Read our memory */
@@ -217,7 +217,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf 
*target,
cur_rchunk-rc_target.rs_handle = htonl(seg-mr_rkey);
cur_rchunk-rc_target.rs_length = htonl(seg-mr_len);
xdr_encode_hyper(
-   (u32 *)cur_rchunk-rc_target.rs_offset,
+   (__be32 
*)cur_rchunk-rc_target.rs_offset,
seg-mr_base);

more x86 merge fallout (uml, again)

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7a78a1722380dd3cb5a009dbcd007f92b6b87743
Commit: 7a78a1722380dd3cb5a009dbcd007f92b6b87743
Parent: ca5cd877ae699e758e6f26efc11b01bf6631d427
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:34:31 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

more x86 merge fallout (uml, again)

arch/i386/{Kconfig,Makefile}.cpu got moved

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/Kconfig.i386  |2 +-
 arch/um/Makefile-i386 |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386
index 9876d80..e0ac74e 100644
--- a/arch/um/Kconfig.i386
+++ b/arch/um/Kconfig.i386
@@ -1,6 +1,6 @@
 menu Host processor type and features
 
-source arch/i386/Kconfig.cpu
+source arch/x86/Kconfig.cpu
 
 endmenu
 
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 08433f8..b01dfb0 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -28,7 +28,7 @@ CONFIG_X86_32 := y
 export CONFIG_X86_32
 
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
-include $(srctree)/arch/i386/Makefile.cpu
+include $(srctree)/arch/x86/Makefile_32.cpu
 
 # prevent gcc from keeping the stack 16 byte aligned. Taken from i386.
 cflags-y += $(call cc-option,-mpreferred-stack-boundary=2)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


missing atomic_read_long() in slub.c

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27bb628a1d759cc82ff6360becf61de601907811
Commit: 27bb628a1d759cc82ff6360becf61de601907811
Parent: 2d8a972661832719931b0dd5b80e97215cb93d94
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:42:55 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

missing atomic_read_long() in slub.c

nr_slabs is atomic_long_t, not atomic_t

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/slub.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index aac1dd3..bcdb2c8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2734,7 +2734,7 @@ static void slab_mem_offline_callback(void *arg)
 * and offline_pages() function shoudn't call this
 * callback. So, we must fail.
 */
-   BUG_ON(atomic_read(n-nr_slabs));
+   BUG_ON(atomic_long_read(n-nr_slabs));
 
s-node[offline_node] = NULL;
kmem_cache_free(kmalloc_caches, n);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Revert x86_64: allocate sparsemem memmap above 4G

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6a22c57b8d2a62dea7280a6b2ac807a539ef0716
Commit: 6a22c57b8d2a62dea7280a6b2ac807a539ef0716
Parent: 3529a233421fc43fa7bfdf7a4317daf28348a23d
Author: Linus Torvalds [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 11:36:04 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 14:05:37 2007 -0700

Revert x86_64: allocate sparsemem memmap above 4G

This reverts commit 2e1c49db4c640b35df13889b86b9d62215ade4b6.

First off, testing in Fedora has shown it to cause boot failures,
bisected down by Martin Ebourne, and reported by Dave Jobes.  So the
commit will likely be reverted in the 2.6.23 stable kernels.

Secondly, in the 2.6.24 model, x86-64 has now grown support for
SPARSEMEM_VMEMMAP, which disables the relevant code anyway, so while the
bug is not visible any more, it's become invisible due to the code just
being irrelevant and no longer enabled on the only architecture that
this ever affected.

Reported-by: Dave Jones [EMAIL PROTECTED]
Tested-by: Martin Ebourne [EMAIL PROTECTED]
Cc: Zou Nan hai [EMAIL PROTECTED]
Cc: Suresh Siddha [EMAIL PROTECTED]
Cc: Andrew Morton [EMAIL PROTECTED]
Acked-by: Andy Whitcroft [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/x86/mm/init_64.c   |6 --
 include/linux/bootmem.h |1 -
 mm/sparse.c |   11 ---
 3 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 1e3862e..a7308b2 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -728,12 +728,6 @@ int in_gate_area_no_task(unsigned long addr)
return (addr = VSYSCALL_START)  (addr  VSYSCALL_END);
 }
 
-void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
-{
-   return __alloc_bootmem_core(pgdat-bdata, size,
-   SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0);
-}
-
 const char *arch_vma_name(struct vm_area_struct *vma)
 {
if (vma-vm_mm  vma-vm_start == (long)vma-vm_mm-context.vdso)
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index c83534e..0365ec9 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -59,7 +59,6 @@ extern void *__alloc_bootmem_core(struct bootmem_data *bdata,
  unsigned long align,
  unsigned long goal,
  unsigned long limit);
-extern void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size);
 
 #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
 extern void reserve_bootmem(unsigned long addr, unsigned long size);
diff --git a/mm/sparse.c b/mm/sparse.c
index 08fb14f..e06f514 100644
--- a/mm/sparse.c
+++ b/mm/sparse.c
@@ -220,12 +220,6 @@ static int __meminit sparse_init_one_section(struct 
mem_section *ms,
return 1;
 }
 
-__attribute__((weak)) __init
-void *alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size)
-{
-   return NULL;
-}
-
 static unsigned long usemap_size(void)
 {
unsigned long size_bytes;
@@ -267,11 +261,6 @@ struct page __init *sparse_mem_map_populate(unsigned long 
pnum, int nid)
if (map)
return map;
 
-   map = alloc_bootmem_high_node(NODE_DATA(nid),
-   sizeof(struct page) * PAGES_PER_SECTION);
-   if (map)
-   return map;
-
map = alloc_bootmem_node(NODE_DATA(nid),
sizeof(struct page) * PAGES_PER_SECTION);
return map;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: make kernel/sched.c:account_guest_time() static

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f7402e0361d4472535e07cfca648f2fa81d85cd2
Commit: f7402e0361d4472535e07cfca648f2fa81d85cd2
Parent: 3529a233421fc43fa7bfdf7a4317daf28348a23d
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:10 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:10 2007 +0100

sched: make kernel/sched.c:account_guest_time() static

account_guest_time() can become static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index b4fbbc4..74dbb40 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3355,7 +3355,7 @@ void account_user_time(struct task_struct *p, cputime_t 
cputime)
  * @p: the process that the cpu time gets accounted to
  * @cputime: the cpu time spent in virtual machine since the last update
  */
-void account_guest_time(struct task_struct *p, cputime_t cputime)
+static void account_guest_time(struct task_struct *p, cputime_t cputime)
 {
cputime64_t tmp;
struct cpu_usage_stat *cpustat = kstat_this_cpu.cpustat;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: keep utime/stime monotonic

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
Commit: 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
Parent: f7402e0361d4472535e07cfca648f2fa81d85cd2
Author: Peter Zijlstra [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: keep utime/stime monotonic

keep utime/stime monotonic.

cpustats use utime/stime as a ratio against sum_exec_runtime, as a
consequence it can happen - when the ratio changes faster than time
accumulates - that either can be appear to go backwards.

Signed-off-by: Peter Zijlstra [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 fs/proc/array.c   |3 ++-
 include/linux/sched.h |1 +
 kernel/fork.c |1 +
 3 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/proc/array.c b/fs/proc/array.c
index 63c95af..d80baaa 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -358,7 +358,8 @@ static cputime_t task_utime(struct task_struct *p)
}
utime = (clock_t)temp;
 
-   return clock_t_to_cputime(utime);
+   p-prev_utime = max(p-prev_utime, clock_t_to_cputime(utime));
+   return p-prev_utime;
 }
 
 static cputime_t task_stime(struct task_struct *p)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 3c07d59..b0b1fe6 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1009,6 +1009,7 @@ struct task_struct {
unsigned int rt_priority;
cputime_t utime, stime, utimescaled, stimescaled;
cputime_t gtime;
+   cputime_t prev_utime;
unsigned long nvcsw, nivcsw; /* context switch counts */
struct timespec start_time; /* monotonic time */
struct timespec real_start_time;/* boot based time */
diff --git a/kernel/fork.c b/kernel/fork.c
index ddafdfa..a65bfc4 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1056,6 +1056,7 @@ static struct task_struct *copy_process(unsigned long 
clone_flags,
p-gtime = cputime_zero;
p-utimescaled = cputime_zero;
p-stimescaled = cputime_zero;
+   p-prev_utime = cputime_zero;
 
 #ifdef CONFIG_TASK_XACCT
p-rchar = 0;   /* I/O counter: bytes read */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: move rcu_head to task_group struct

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae8393e508e5f17add66964688c49bf0bfe4fcf9
Commit: ae8393e508e5f17add66964688c49bf0bfe4fcf9
Parent: 7bae49d498de87f0da0c20c67adaa278eac84566
Author: Srivatsa Vaddagiri [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: move rcu_head to task_group struct

Peter Zijlstra noticed that the rcu_head object need not be present
in every cfs_rq of a group. Move it to the task_group structure
instead.

Signed-off-by: Srivatsa Vaddagiri [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 235952b..4704807 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -172,6 +172,7 @@ struct task_group {
unsigned long shares;
/* spinlock to serialize modification to shares */
spinlock_t lock;
+   struct rcu_head rcu;
 };
 
 /* Default task group's sched entity on each cpu */
@@ -258,7 +259,6 @@ struct cfs_rq {
 */
struct list_head leaf_cfs_rq_list; /* Better name : task_cfs_rq_list? */
struct task_group *tg;/* group that owns this runqueue */
-   struct rcu_head rcu;
 #endif
 };
 
@@ -7019,8 +7019,8 @@ err:
 /* rcu callback to free various structures associated with a task group */
 static void free_sched_group(struct rcu_head *rhp)
 {
-   struct cfs_rq *cfs_rq = container_of(rhp, struct cfs_rq, rcu);
-   struct task_group *tg = cfs_rq-tg;
+   struct task_group *tg = container_of(rhp, struct task_group, rcu);
+   struct cfs_rq *cfs_rq;
struct sched_entity *se;
int i;
 
@@ -7052,7 +7052,7 @@ void sched_destroy_group(struct task_group *tg)
BUG_ON(!cfs_rq);
 
/* wait for possible concurrent references to cfs_rqs complete */
-   call_rcu(cfs_rq-rcu, free_sched_group);
+   call_rcu(tg-rcu, free_sched_group);
 }
 
 /* change task's runqueue when it moves between groups.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: report CPU usage in CFS cgroup directories

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fe5c7cc22897b809a2fbe05bea71963853df7f17
Commit: fe5c7cc22897b809a2fbe05bea71963853df7f17
Parent: ae8393e508e5f17add66964688c49bf0bfe4fcf9
Author: Paul Menage [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: report CPU usage in CFS cgroup directories

Adds a cpu.usage file to the CFS cgroup that reports CPU usage in
milliseconds for that cgroup's tasks

[ [EMAIL PROTECTED]: style cleanups. ]

Signed-off-by: Paul Menage [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |   38 +-
 1 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 4704807..6c4abfb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7211,15 +7211,43 @@ static u64 cpu_shares_read_uint(struct cgroup *cgrp, 
struct cftype *cft)
return (u64) tg-shares;
 }
 
-static struct cftype cpu_shares = {
-   .name = shares,
-   .read_uint = cpu_shares_read_uint,
-   .write_uint = cpu_shares_write_uint,
+static u64 cpu_usage_read(struct cgroup *cgrp, struct cftype *cft)
+{
+   struct task_group *tg = cgroup_tg(cgrp);
+   unsigned long flags;
+   u64 res = 0;
+   int i;
+
+   for_each_possible_cpu(i) {
+   /*
+* Lock to prevent races with updating 64-bit counters
+* on 32-bit arches.
+*/
+   spin_lock_irqsave(cpu_rq(i)-lock, flags);
+   res += tg-se[i]-sum_exec_runtime;
+   spin_unlock_irqrestore(cpu_rq(i)-lock, flags);
+   }
+   /* Convert from ns to ms */
+   do_div(res, 100);
+
+   return res;
+}
+
+static struct cftype cpu_files[] = {
+   {
+   .name = shares,
+   .read_uint = cpu_shares_read_uint,
+   .write_uint = cpu_shares_write_uint,
+   },
+   {
+   .name = usage,
+   .read_uint = cpu_usage_read,
+   },
 };
 
 static int cpu_cgroup_populate(struct cgroup_subsys *ss, struct cgroup *cont)
 {
-   return cgroup_add_file(cont, ss, cpu_shares);
+   return cgroup_add_files(cont, ss, cpu_files, ARRAY_SIZE(cpu_files));
 }
 
 struct cgroup_subsys cpu_cgroup_subsys = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: fix incorrect assumption that cpu 0 exists

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7bae49d498de87f0da0c20c67adaa278eac84566
Commit: 7bae49d498de87f0da0c20c67adaa278eac84566
Parent: 73a2bcb0edb9ffb0b007b3546b430e2c6e415eee
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: fix incorrect assumption that cpu 0 exists

This patch:

commit 9b5b77512dce239fa168183fa71896712232e95a
Author: Srivatsa Vaddagiri [EMAIL PROTECTED]
Date:   Mon Oct 15 17:00:09 2007 +0200

sched: clean up code under CONFIG_FAIR_GROUP_SCHED

Introduced an assumption of the existence of CPU0 via this line

cfs_rq = tg-cfs_rq[0];

If you have no CPU0, that will be NULL.  The fix seems to be just to
take whatever cfs_rq queue comes out of the for_each_possible_cpu()
loop, since they're all equally good for the destruction operation.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 74dbb40..235952b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7041,7 +7041,7 @@ static void free_sched_group(struct rcu_head *rhp)
 /* Destroy runqueue etc associated with a task group */
 void sched_destroy_group(struct task_group *tg)
 {
-   struct cfs_rq *cfs_rq;
+   struct cfs_rq *cfs_rq = NULL;
int i;
 
for_each_possible_cpu(i) {
@@ -7049,7 +7049,7 @@ void sched_destroy_group(struct task_group *tg)
list_del_rcu(cfs_rq-leaf_cfs_rq_list);
}
 
-   cfs_rq = tg-cfs_rq[0];
+   BUG_ON(!cfs_rq);
 
/* wait for possible concurrent references to cfs_rqs complete */
call_rcu(cfs_rq-rcu, free_sched_group);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: fix style in kernel/sched.c

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38605cae99d386332df6822a22dba7bfdc8fae1c
Commit: 38605cae99d386332df6822a22dba7bfdc8fae1c
Parent: 8eb172d9418c9387234a2c9a344131c46b5eea5b
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: fix style in kernel/sched.c

fallout of recent commits: small coding style fixes.

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 6c4abfb..3f6bd11 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5365,7 +5365,7 @@ static struct ctl_table sd_ctl_dir[] = {
.procname   = sched_domain,
.mode   = 0555,
},
-   {0,},
+   {0, },
 };
 
 static struct ctl_table sd_ctl_root[] = {
@@ -5375,7 +5375,7 @@ static struct ctl_table sd_ctl_root[] = {
.mode   = 0555,
.child  = sd_ctl_dir,
},
-   {0,},
+   {0, },
 };
 
 static struct ctl_table *sd_alloc_ctl_entry(int n)
@@ -7251,13 +7251,13 @@ static int cpu_cgroup_populate(struct cgroup_subsys 
*ss, struct cgroup *cont)
 }
 
 struct cgroup_subsys cpu_cgroup_subsys = {
-   .name   = cpu,
-   .create = cpu_cgroup_create,
-   .destroy= cpu_cgroup_destroy,
-   .can_attach = cpu_cgroup_can_attach,
-   .attach = cpu_cgroup_attach,
-   .populate   = cpu_cgroup_populate,
-   .subsys_id  = cpu_cgroup_subsys_id,
+   .name   = cpu,
+   .create = cpu_cgroup_create,
+   .destroy= cpu_cgroup_destroy,
+   .can_attach = cpu_cgroup_can_attach,
+   .attach = cpu_cgroup_attach,
+   .populate   = cpu_cgroup_populate,
+   .subsys_id  = cpu_cgroup_subsys_id,
.early_init = 1,
 };
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] SMTC: Allow control over TC assignment to vpe0.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be5f1f2114665508a722e3924a3a7f477c502841
Commit: be5f1f2114665508a722e3924a3a7f477c502841
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Kevin D. Kissell [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 13:28:37 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:32 2007 +

[MIPS] SMTC: Allow control over TC assignment to vpe0.

Modify the SMTC initialization code to allow boot-time specification not
only of how many VPEs and TCs to use, but also how many TCs out of the
allowed pool are to be bound to VPE 0.  The new boot option is vpe0tcs=N,
where N is an integer.  Using it in combination with the existing options
allows arbitrary assignments across the 2 VPEs of a 34K.  e.g. maxtcs=3
 vpe0tcs=1 forces VPE0 to have 1 TC, while VPE1 has 2, and maxtcs=4
vpe0tcs=3 forces VPE0 to have 3 TCs, while VPE1 gets 1.  If no vpe0tcs
option is specified, the traditional algorithm of evenly dividing TCs
between available VPEs, with the odd slop going to VPE0, is retained.

The reason for doing this is to allow a finer balancing of TCs which can
handle I/O interrupts on Malta (those on VPE 0) and those which cannot.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/smtc.c |   57 --
 1 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index a8c1a69..9c92d42 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -88,11 +88,19 @@ unsigned int smtc_status = 0;
 
 /* Boot command line configuration overrides */
 
+static int vpe0limit;
 static int ipibuffers = 0;
 static int nostlb = 0;
 static int asidmask = 0;
 unsigned long smtc_asid_mask = 0xff;
 
+static int __init vpe0tcs(char *str)
+{
+   get_option(str, vpe0limit);
+
+   return 1;
+}
+
 static int __init ipibufs(char *str)
 {
get_option(str, ipibuffers);
@@ -125,6 +133,7 @@ static int __init asidmask_set(char *str)
return 1;
 }
 
+__setup(vpe0tcs=, vpe0tcs);
 __setup(ipibufs=, ipibufs);
 __setup(nostlb, stlb_disable);
 __setup(asidmask=, asidmask_set);
@@ -340,7 +349,7 @@ static void smtc_tc_setup(int vpe, int tc, int cpu)
 
 void mipsmt_prepare_cpus(void)
 {
-   int i, vpe, tc, ntc, nvpe, tcpervpe, slop, cpu;
+   int i, vpe, tc, ntc, nvpe, tcpervpe[NR_CPUS], slop, cpu;
unsigned long flags;
unsigned long val;
int nipi;
@@ -401,8 +410,39 @@ void mipsmt_prepare_cpus(void)
ntc = NR_CPUS;
if (tclimit  0  ntc  tclimit)
ntc = tclimit;
-   tcpervpe = ntc / nvpe;
-   slop = ntc % nvpe;  /* Residual TCs,  NVPE */
+   slop = ntc % nvpe;
+   for (i = 0; i  nvpe; i++) {
+   tcpervpe[i] = ntc / nvpe;
+   if (slop) {
+   if((slop - i)  0) tcpervpe[i]++;
+   }
+   }
+   /* Handle command line override for VPE0 */
+   if (vpe0limit  ntc) vpe0limit = ntc;
+   if (vpe0limit  0) {
+   int slopslop;
+   if (vpe0limit  tcpervpe[0]) {
+   /* Reducing TC count - distribute to others */
+   slop = tcpervpe[0] - vpe0limit;
+   slopslop = slop % (nvpe - 1);
+   tcpervpe[0] = vpe0limit;
+   for (i = 1; i  nvpe; i++) {
+   tcpervpe[i] += slop / (nvpe - 1);
+   if(slopslop  ((slopslop - (i - 1)  0)))
+   tcpervpe[i]++;
+   }
+   } else if (vpe0limit  tcpervpe[0]) {
+   /* Increasing TC count - steal from others */
+   slop = vpe0limit - tcpervpe[0];
+   slopslop = slop % (nvpe - 1);
+   tcpervpe[0] = vpe0limit;
+   for (i = 1; i  nvpe; i++) {
+   tcpervpe[i] -= slop / (nvpe - 1);
+   if(slopslop  ((slopslop - (i - 1)  0)))
+   tcpervpe[i]--;
+   }
+   }
+   }
 
/* Set up shared TLB */
smtc_configure_tlb();
@@ -416,7 +456,7 @@ void mipsmt_prepare_cpus(void)
if (vpe != 0)
printk(, );
printk(VPE %d: TC, vpe);
-   for (i = 0; i  tcpervpe; i++) {
+   for (i = 0; i  tcpervpe[vpe]; i++) {
/*
 * TC 0 is bound to VPE 0 at reset,
 * and is presumably executing this
@@ -429,15 +469,6 @@ void mipsmt_prepare_cpus(void)
printk( %d, tc);
tc++;
}
-   if (slop) {
-   if (tc != 0) {
-   smtc_tc_setup(vpe, tc, cpu);
- 

[MIPS] Alchemy: Nuke homebrew setup_irq(), it's broken and unnecessary.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=310a09d8508b8e048c7efdf53bb91f2cd787b58e
Commit: 310a09d8508b8e048c7efdf53bb91f2cd787b58e
Parent: be5f1f2114665508a722e3924a3a7f477c502841
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 02:59:55 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:32 2007 +

[MIPS] Alchemy: Nuke homebrew setup_irq(), it's broken and unnecessary.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/au1000/common/irq.c  |   32 
 arch/mips/au1000/common/time.c |   11 +--
 2 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/arch/mips/au1000/common/irq.c b/arch/mips/au1000/common/irq.c
index 59e932a..ddfb7f0 100644
--- a/arch/mips/au1000/common/irq.c
+++ b/arch/mips/au1000/common/irq.c
@@ -318,38 +318,6 @@ static struct irq_chip level_irq_type = {
.end= end_irq,
 };
 
-#ifdef CONFIG_PM
-void startup_match20_interrupt(irq_handler_t handler)
-{
-   struct irq_desc *desc = irq_desc[AU1000_TOY_MATCH2_INT];
-
-   static struct irqaction action;
-   memset(action, 0, sizeof(struct irqaction));
-
-   /*
-* This is a big problem since we didn't use request_irq
-* when kernel/irq.c calls probe_irq_xxx this interrupt will
-* be probed for usage. This will end up disabling the device :(
-* Give it a bogus action pointer -- this will keep it from
-* getting auto-probed!
-*
-* By setting the status to match that of request_irq() we
-* can avoid it.  --cgray
-   */
-   action.dev_id = handler;
-   action.flags = IRQF_DISABLED;
-   cpus_clear(action.mask);
-   action.name = Au1xxx TOY;
-   action.handler = handler;
-   action.next = NULL;
-
-   desc-action = action;
-   desc-status = ~(IRQ_DISABLED | IRQ_AUTODETECT | IRQ_WAITING | 
IRQ_INPROGRESS);
-
-   local_enable_irq(AU1000_TOY_MATCH2_INT);
-}
-#endif
-
 static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req)
 {
unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 2556399..c8116bc 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -67,7 +67,7 @@ static DEFINE_SPINLOCK(time_lock);
 unsigned long wtimer;
 
 #ifdef CONFIG_PM
-irqreturn_t counter0_irq(int irq, void *dev_id)
+static irqreturn_t counter0_irq(int irq, void *dev_id)
 {
unsigned long pc0;
int time_elapsed;
@@ -117,6 +117,13 @@ irqreturn_t counter0_irq(int irq, void *dev_id)
return IRQ_HANDLED;
 }
 
+struct irqaction counter0_action = {
+   .handler= counter0_irq,
+   .flags  = IRQF_DISABLED,
+   .name   = alchemy-toy,
+   .dev_id = NULL,
+};
+
 /* When we wakeup from sleep, we have to catch up on all of the
  * timer ticks we have missed.
  */
@@ -280,7 +287,7 @@ void __init plat_timer_setup(struct irqaction *irq)
au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
au_sync();
while (au_readl(SYS_COUNTER_CNTRL)  SYS_CNTRL_M20);
-   startup_match20_interrupt(counter0_irq);
+   setup_irq(AU1000_TOY_MATCH2_INT, counter0_action);
 
/* We can use the real 'wait' instruction.
*/
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Use non-interrupt locks in GT641xx clockevent driver

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c984c87826a6e3b2adae1fab8d5bddcf26af8c78
Commit: c984c87826a6e3b2adae1fab8d5bddcf26af8c78
Parent: 2c771a4c28a71b6acc0bd6b7ef56e0a1849c9b09
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 18:19:13 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:33 2007 +

[MIPS] time: Use non-interrupt locks in GT641xx clockevent driver

set_next_event() and set_mode() are always called with interrupt disabled.
irqsave and irqrestore are not necessary for spinlock.
Pointed out by Atsushi Nemoto.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/cevt-gt641xx.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index 4c651b2..155ef81 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -49,10 +49,9 @@ int gt641xx_timer0_state(void)
 static int gt641xx_timer0_set_next_event(unsigned long delta,
 struct clock_event_device *evt)
 {
-   unsigned long flags;
u32 ctrl;
 
-   spin_lock_irqsave(gt641xx_timer_lock, flags);
+   spin_lock(gt641xx_timer_lock);
 
ctrl = GT_READ(GT_TC_CONTROL_OFS);
ctrl = ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -61,7 +60,7 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
GT_WRITE(GT_TC0_OFS, delta);
GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-   spin_unlock_irqrestore(gt641xx_timer_lock, flags);
+   spin_unlock(gt641xx_timer_lock);
 
return 0;
 }
@@ -69,10 +68,9 @@ static int gt641xx_timer0_set_next_event(unsigned long delta,
 static void gt641xx_timer0_set_mode(enum clock_event_mode mode,
struct clock_event_device *evt)
 {
-   unsigned long flags;
u32 ctrl;
 
-   spin_lock_irqsave(gt641xx_timer_lock, flags);
+   spin_lock(gt641xx_timer_lock);
 
ctrl = GT_READ(GT_TC_CONTROL_OFS);
ctrl = ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK);
@@ -90,7 +88,7 @@ static void gt641xx_timer0_set_mode(enum clock_event_mode 
mode,
 
GT_WRITE(GT_TC_CONTROL_OFS, ctrl);
 
-   spin_unlock_irqrestore(gt641xx_timer_lock, flags);
+   spin_unlock(gt641xx_timer_lock);
 }
 
 static void gt641xx_timer0_event_handler(struct clock_event_device *dev)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Cleanup random difference between the lmo and kernel.org tree.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6e86b0bf0bd997aad4a5f67b1cba90db11ade6e3
Commit: 6e86b0bf0bd997aad4a5f67b1cba90db11ade6e3
Parent: 11c03a6faa471ae37f4fd3db79389ae6297b66db
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 19:35:33 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:33 2007 +

[MIPS] Cleanup random difference between the lmo and kernel.org tree.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/mm/dma-default.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index b1b4052..33519ce 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -12,8 +12,8 @@
 #include linux/dma-mapping.h
 #include linux/mm.h
 #include linux/module.h
-#include linux/string.h
 #include linux/scatterlist.h
+#include linux/string.h
 
 #include asm/cache.h
 #include asm/io.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Alchemy: micro-optimizatize time code.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c771a4c28a71b6acc0bd6b7ef56e0a1849c9b09
Commit: 2c771a4c28a71b6acc0bd6b7ef56e0a1849c9b09
Parent: 310a09d8508b8e048c7efdf53bb91f2cd787b58e
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 03:04:19 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:32 2007 +

[MIPS] Alchemy: micro-optimizatize time code.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/au1000/common/time.c |9 ++---
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index c8116bc..0673fc0 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -262,15 +262,10 @@ void __init plat_timer_setup(struct irqaction *irq)
 * we do this.
 */
if (no_au1xxx_32khz) {
-   unsigned int c0_status;
-
printk(WARNING: no 32KHz clock found.\n);
 
-   /* Ensure we get CPO_COUNTER interrupts.
-   */
-   c0_status = read_c0_status();
-   c0_status |= IE_IRQ5;
-   write_c0_status(c0_status);
+   /* Ensure we get CPO_COUNTER interrupts.  */
+   set_c0_status(IE_IRQ5);
}
else {
while (au_readl(SYS_COUNTER_CNTRL)  SYS_CNTRL_C0S);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: set clock before clockevent_delta2ns() in GT641xx.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11c03a6faa471ae37f4fd3db79389ae6297b66db
Commit: 11c03a6faa471ae37f4fd3db79389ae6297b66db
Parent: c984c87826a6e3b2adae1fab8d5bddcf26af8c78
Author: Yoichi Yuasa [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 18:22:50 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:33 2007 +

[MIPS] time: set clock before clockevent_delta2ns() in GT641xx.

clockevent_delta2ns() use the shift and mult value, so
clockevent_set_clock() should be called first.
Pointed out by Atsushi Nemoto.

Signed-off-by: Yoichi Yuasa [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/cevt-gt641xx.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index 155ef81..c367726 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -131,9 +131,9 @@ static int __init gt641xx_timer0_clockevent_init(void)
 
cd = gt641xx_timer0_clockevent;
cd-rating = 200 + gt641xx_base_clock / 1000;
+   clockevent_set_clock(cd, gt641xx_base_clock);
cd-max_delta_ns = clockevent_delta2ns(0x7fff, cd);
cd-min_delta_ns = clockevent_delta2ns(0x300, cd);
-   clockevent_set_clock(cd, gt641xx_base_clock);
 
clockevents_register_device(gt641xx_timer0_clockevent);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Alchemy: Convert from plat_timer_setup to plat_time_init.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bc2f2a24d9cd52bd6f5307ab36ffa041366d936d
Commit: bc2f2a24d9cd52bd6f5307ab36ffa041366d936d
Parent: 82923663419d376b6c418d353231efb3f7c2b878
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 12:58:02 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:33 2007 +

[MIPS] Alchemy: Convert from plat_timer_setup to plat_time_init.

The old plat_timer_setup hook is no longer getting called so the Alchemy
time initialization was getting skipped.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/au1000/common/time.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/au1000/common/time.c b/arch/mips/au1000/common/time.c
index 0673fc0..f113b51 100644
--- a/arch/mips/au1000/common/time.c
+++ b/arch/mips/au1000/common/time.c
@@ -228,7 +228,7 @@ unsigned long cal_r4koff(void)
return (cpu_speed / HZ);
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
+void __init plat_time_init(void)
 {
unsigned int est_freq;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] vpe: Use p_paddr instead of p_vaddr loader.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82923663419d376b6c418d353231efb3f7c2b878
Commit: 82923663419d376b6c418d353231efb3f7c2b878
Parent: 6e86b0bf0bd997aad4a5f67b1cba90db11ade6e3
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Wed Oct 24 15:54:32 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:33 2007 +

[MIPS] vpe: Use p_paddr instead of p_vaddr loader.

This subtle difference makes ELF overlays work.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/vpe.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index df8cbe4..436a64f 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -942,8 +942,8 @@ static int vpe_elfload(struct vpe * v)
if (phdr-p_type != PT_LOAD)
continue;
 
-   memcpy((void *)phdr-p_vaddr, (char *)hdr + 
phdr-p_offset, phdr-p_filesz);
-   memset((void *)phdr-p_vaddr + phdr-p_filesz, 0, 
phdr-p_memsz - phdr-p_filesz);
+   memcpy((void *)phdr-p_paddr, (char *)hdr + 
phdr-p_offset, phdr-p_filesz);
+   memset((void *)phdr-p_paddr + phdr-p_filesz, 0, 
phdr-p_memsz - phdr-p_filesz);
phdr++;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Remove declaration of plat_timer_setup, there is no caller.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0d0cc920de658126560938a01f12e6e8ca7d5bcd
Commit: 0d0cc920de658126560938a01f12e6e8ca7d5bcd
Parent: bc2f2a24d9cd52bd6f5307ab36ffa041366d936d
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:23:02 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] time: Remove declaration of plat_timer_setup, there is no caller.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 include/asm-mips/time.h |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/time.h b/include/asm-mips/time.h
index bc47af3..ce1e07a 100644
--- a/include/asm-mips/time.h
+++ b/include/asm-mips/time.h
@@ -58,7 +58,6 @@ extern void local_timer_interrupt(int irq, void *dev_id);
  */
 struct irqaction;
 extern void plat_time_init(void);
-extern void plat_timer_setup(struct irqaction *irq);
 
 /*
  * mips_hpt_frequency - must be set if you intend to use an R4k-compatible
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Cause platform definitions of plat_timer_setup to cause error.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=656db5061dc5758dc52cdbf26de5cd25aca82d7a
Commit: 656db5061dc5758dc52cdbf26de5cd25aca82d7a
Parent: 0d0cc920de658126560938a01f12e6e8ca7d5bcd
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:24:06 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] time: Cause platform definitions of plat_timer_setup to cause error.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/time.c |   17 -
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index 6c6849a..27228f5 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -11,6 +11,7 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  */
+#include linux/bug.h
 #include linux/clockchips.h
 #include linux/types.h
 #include linux/kernel.h
@@ -115,10 +116,6 @@ EXPORT_SYMBOL(perf_irq);
  * (only needed if you intended to use cpu counter as timer interrupt
  *  source)
  * 2) calculate a couple of cached variables for later usage
- * 3) plat_timer_setup() -
- * a) (optional) over-write any choices made above by time_init().
- * b) machine specific code should setup the timer irqaction.
- * c) enable the timer interrupt
  */
 
 unsigned int mips_hpt_frequency;
@@ -221,8 +218,18 @@ void __init __weak plat_time_init(void)
 {
 }
 
-void __init __weak plat_timer_setup(struct irqaction *irq)
+/*
+ * This function exists in order to cause an error due to a duplicate
+ * definition if platform code should have its own implementation.  The hook
+ * to use instead is plat_time_init.  plat_time_init does not receive the
+ * irqaction pointer argument anymore.  This is because any function which
+ * initializes an interrupt timer now takes care of its own request_irq rsp.
+ * setup_irq calls and each clock_event_device should use its own
+ * struct irqrequest.
+ */
+void __init plat_timer_setup(struct irqaction *irq)
 {
+   BUG();
 }
 
 void __init time_init(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sched: fix style of swap() macro in kernel/sched_fair.c

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8eb172d9418c9387234a2c9a344131c46b5eea5b
Commit: 8eb172d9418c9387234a2c9a344131c46b5eea5b
Parent: fe5c7cc22897b809a2fbe05bea71963853df7f17
Author: Ingo Molnar [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 21:18:11 2007 +0100
Committer:  Ingo Molnar [EMAIL PROTECTED]
CommitDate: Mon Oct 29 21:18:11 2007 +0100

sched: fix style of swap() macro in kernel/sched_fair.c

fix style of swap() macro in kernel/sched_fair.c.

( this macro should eventually move to a general header, as ext3 uses
  a similar construct too. )

Signed-off-by: Ingo Molnar [EMAIL PROTECTED]
---
 kernel/sched_fair.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 9971831..01859f6 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1025,7 +1025,7 @@ static void task_tick_fair(struct rq *rq, struct 
task_struct *curr)
}
 }
 
-#define swap(a,b) do { typeof(a) tmp = (a); (a) = (b); (b) = tmp; } while (0)
+#define swap(a, b) do { typeof(a) tmp = (a); (a) = (b); (b) = tmp; } while (0)
 
 /*
  * Share the fairness runtime between parent and child, thus the
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] SNI: Convert a20r timer to clockevent device.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=84953b39f9b57f89f87b5974c599b8111658f0b6
Commit: 84953b39f9b57f89f87b5974c599b8111658f0b6
Parent: e0511f75246df404e72fc1376967253d2f460c34
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 14:36:10 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] SNI: Convert a20r timer to clockevent device.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/sni/time.c |   80 --
 1 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 0910b35..60bc62e 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -11,27 +11,78 @@
 #define SNI_COUNTER2_DIV64
 #define SNI_COUNTER0_DIV((SNI_CLOCK_TICK_RATE / SNI_COUNTER2_DIV) / HZ)
 
-static void sni_a20r_timer_ack(void)
+static void a20r_set_mode(enum clock_event_mode mode,
+  struct clock_event_device *evt)
 {
-*(volatile u8 *)A20R_PT_TIM0_ACK = 0x0; wmb();
+   switch (mode) {
+   case CLOCK_EVT_MODE_PERIODIC:
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34;
+   wmb();
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = SNI_COUNTER0_DIV;
+   wmb();
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = SNI_COUNTER0_DIV  
8;
+   wmb();
+
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4;
+   wmb();
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = SNI_COUNTER2_DIV;
+   wmb();
+   *(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = SNI_COUNTER2_DIV  
8;
+   wmb();
+
+break;
+case CLOCK_EVT_MODE_ONESHOT:
+case CLOCK_EVT_MODE_UNUSED:
+case CLOCK_EVT_MODE_SHUTDOWN:
+break;
+case CLOCK_EVT_MODE_RESUME:
+break;
+}
 }
 
+static struct clock_event_device a20r_clockevent_device = {
+   .name   = a20r-timer,
+   .features   = CLOCK_EVT_FEAT_PERIODIC,
+
+   /* .mult, .shift, .max_delta_ns and .min_delta_ns left uninitialized */
+
+   .rating = 300,
+   .irq= SNI_A20R_IRQ_TIMER,
+   .set_mode   = a20r_set_mode,
+};
+
+static irqreturn_t a20r_interrupt(int irq, void *dev_id)
+{
+   struct clock_event_device *cd = dev_id;
+
+   *(volatile u8 *)A20R_PT_TIM0_ACK = 0;
+   wmb();
+
+   cd-event_handler(cd);
+
+   return IRQ_HANDLED;
+}
+
+static struct irqaction a20r_irqaction = {
+   .handler= a20r_interrupt,
+   .flags  = IRQF_DISABLED | IRQF_PERCPU,
+   .name   = a20r-timer,
+};
+
 /*
  * a20r platform uses 2 counters to divide the input frequency.
  * Counter 2 output is connected to Counter 0  1 input.
  */
-static void __init sni_a20r_timer_setup(struct irqaction *irq)
+static void __init sni_a20r_timer_setup(void)
 {
-*(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0x34; wmb();
-*(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = (SNI_COUNTER0_DIV)  0xff; 
wmb();
-*(volatile u8 *)(A20R_PT_CLOCK_BASE +  0) = (SNI_COUNTER0_DIV  8)  
0xff; wmb();
+   struct clock_event_device *cd = a20r_clockevent_device;
+   struct irqaction *action = a20r_irqaction;
+   unsigned int cpu = smp_processor_id();
 
-*(volatile u8 *)(A20R_PT_CLOCK_BASE + 12) = 0xb4; wmb();
-*(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = (SNI_COUNTER2_DIV)  0xff; 
wmb();
-*(volatile u8 *)(A20R_PT_CLOCK_BASE +  8) = (SNI_COUNTER2_DIV  8)  
0xff; wmb();
+   cd-cpumask = cpumask_of_cpu(cpu);
 
-setup_irq(SNI_A20R_IRQ_TIMER, irq);
-mips_timer_ack = sni_a20r_timer_ack;
+   action-dev_id = cd;
+   setup_irq(SNI_A20R_IRQ_TIMER, a20r_irqaction);
 }
 
 #define SNI_8254_TICK_RATE1193182UL
@@ -119,17 +170,14 @@ void __init plat_time_init(void)
mips_hpt_frequency = r4k_tick * HZ;
 
setup_pit_timer();
-}
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
switch (sni_brd_type) {
case SNI_BRD_10:
case SNI_BRD_10NEW:
case SNI_BRD_TOWER_OASIC:
case SNI_BRD_MINITOWER:
-   sni_a20r_timer_setup(irq);
-   break;
+   sni_a20r_timer_setup();
+   break;
}
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Remove wrppmc's definition of plat_timer_setup.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=da349bef9700e0dbf69e4273fa87c476c46c454f
Commit: da349bef9700e0dbf69e4273fa87c476c46c454f
Parent: 656db5061dc5758dc52cdbf26de5cd25aca82d7a
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:36:15 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] time: Remove wrppmc's definition of plat_timer_setup.

The only thing it used to do is now done by cevt-r4k.c.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/gt64120/wrppmc/time.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/arch/mips/gt64120/wrppmc/time.c b/arch/mips/gt64120/wrppmc/time.c
index b207e7f..668dbd5 100644
--- a/arch/mips/gt64120/wrppmc/time.c
+++ b/arch/mips/gt64120/wrppmc/time.c
@@ -19,12 +19,6 @@
 
 #define WRPPMC_CPU_CLK_FREQ 4000 /* 40MHZ */
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-   /* Install ISR for timer interrupt */
-   setup_irq(WRPPMC_MIPS_TIMER_IRQ, irq);
-}
-
 /*
  * Estimate CPU frequency.  Sets mips_hpt_frequency as a side-effect
  *
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Merge lasat plat_timer_setup into plat_time_init.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba5eac515f73910744c5d9f8fc1c5d6548cf6ff4
Commit: ba5eac515f73910744c5d9f8fc1c5d6548cf6ff4
Parent: da349bef9700e0dbf69e4273fa87c476c46c454f
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:43:32 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] time: Merge lasat plat_timer_setup into plat_time_init.

Since the cp0 compare interrupt handler isn't initialized by the time
plat_time_init is called don't set IE_IRQ5 anymore, cevt-r4k.c will do
that a little later itself.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/lasat/setup.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/mips/lasat/setup.c b/arch/mips/lasat/setup.c
index 54827d0..e072da4 100644
--- a/arch/mips/lasat/setup.c
+++ b/arch/mips/lasat/setup.c
@@ -117,14 +117,11 @@ static struct notifier_block lasat_panic_block[] =
}
 };
 
-void plat_time_init(void)
+void __init plat_time_init(void)
 {
mips_hpt_frequency = lasat_board_info.li_cpu_hz / 2;
-}
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-   change_c0_status(ST0_IM, IE_IRQ0 | IE_IRQ5);
+   change_c0_status(ST0_IM, IE_IRQ0);
 }
 
 void __init plat_mem_setup(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Merge eXcite plat_timer_setup into plat_time_init.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0511f75246df404e72fc1376967253d2f460c34
Commit: e0511f75246df404e72fc1376967253d2f460c34
Parent: ba5eac515f73910744c5d9f8fc1c5d6548cf6ff4
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:52:41 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:34 2007 +

[MIPS] time: Merge eXcite plat_timer_setup into plat_time_init.

Fixme: At the time of this writing cevt-r4k.c doesn't yet know about how
to handle the alternate timer interrupt of the RM9000.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/basler/excite/excite_setup.c |   21 ++---
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/mips/basler/excite/excite_setup.c 
b/arch/mips/basler/excite/excite_setup.c
index 404ca92..24378b9 100644
--- a/arch/mips/basler/excite/excite_setup.c
+++ b/arch/mips/basler/excite/excite_setup.c
@@ -68,24 +68,23 @@ DEFINE_SPINLOCK(titan_lock);
 int titan_irqflags;
 
 
+/*
+ * The eXcite platform uses the alternate timer interrupt
+ *
+ * Fixme: At the time of this writing cevt-r4k.c doesn't yet know about how
+ * to handle the alternate timer interrupt of the RM9000.
+ */
 void __init plat_time_init(void)
 {
const u32 modebit5 = ocd_readl(0x00e4);
-   unsigned int
-   mult = ((modebit5  11)  0x1f) + 2,
-   div = ((modebit5  16)  0x1f) + 2;
+   unsigned int mult = ((modebit5  11)  0x1f) + 2,
+   unsigned int div = ((modebit5  16)  0x1f) + 2;
 
-   if (div == 33) div = 1;
+   if (div == 33)
+   div = 1;
mips_hpt_frequency = EXCITE_CPU_EXT_CLOCK * mult / div / 2;
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
-{
-   /* The eXcite platform uses the alternate timer interrupt */
-   set_c0_intcontrol(0x80);
-   setup_irq(TIMER_IRQ, irq);
-}
-
 static int __init excite_init_console(void)
 {
 #if defined(CONFIG_SERIAL_8250)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Make c0_compare_int_usable faster

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a6c43a78763da67d4049745ce35122734e89fbc
Commit: 3a6c43a78763da67d4049745ce35122734e89fbc
Parent: c637fecb4fe67e2baccef24b9b7e9cb79ee23cf8
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 21:55:42 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:35 2007 +

[MIPS] time: Make c0_compare_int_usable faster

Try increasingly longer time periods starting of at 0x10 cycles.  This
should be fast on hardware and work nicely with emulators.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/cevt-r4k.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 7274fd2..a59f67f 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -179,7 +179,7 @@ static int c0_compare_int_pending(void)
 
 static int c0_compare_int_usable(void)
 {
-   const unsigned int delta = 0x30;
+   unsigned int delta;
unsigned int cnt;
 
/*
@@ -192,9 +192,15 @@ static int c0_compare_int_usable(void)
return 0;
}
 
-   cnt = read_c0_count();
-   cnt += delta;
-   write_c0_compare(cnt);
+   for (delta = 0x10; delta = 0x40; delta = 1) {
+   cnt = read_c0_count();
+   cnt += delta;
+   write_c0_compare(cnt);
+   irq_disable_hazard();
+   if ((int)(read_c0_count() - cnt)  0)
+   break;
+   /* increase delta if the timer was already expired */
+   }
 
while ((int)(read_c0_count() - cnt) = 0)
;   /* Wait for expiry  */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Fix cut'n'paste bug in Sibyte clockevent driver.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1238d5d868a56dcbc743d3ffc9bd3c920258b4cb
Commit: 1238d5d868a56dcbc743d3ffc9bd3c920258b4cb
Parent: 3a6c43a78763da67d4049745ce35122734e89fbc
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 11:36:24 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] time: Fix cut'n'paste bug in Sibyte clockevent driver.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/sibyte/bcm1480/time.c |2 +-
 arch/mips/sibyte/sb1250/time.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/sibyte/bcm1480/time.c b/arch/mips/sibyte/bcm1480/time.c
index 699b5d2..bbf19bf 100644
--- a/arch/mips/sibyte/bcm1480/time.c
+++ b/arch/mips/sibyte/bcm1480/time.c
@@ -119,7 +119,7 @@ void __cpuinit sb1480_clockevent_init(void)
sprintf(name, bcm1480-counter %d, cpu);
cd-name= name;
cd-features= CLOCK_EVT_FEAT_PERIODIC |
- CLOCK_EVT_MODE_ONESHOT;
+ CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
cd-max_delta_ns= clockevent_delta2ns(0x7f, cd);
cd-min_delta_ns= clockevent_delta2ns(1, cd);
diff --git a/arch/mips/sibyte/sb1250/time.c b/arch/mips/sibyte/sb1250/time.c
index f7f455a..95ad34e 100644
--- a/arch/mips/sibyte/sb1250/time.c
+++ b/arch/mips/sibyte/sb1250/time.c
@@ -137,7 +137,7 @@ void __cpuinit sb1250_clockevent_init(void)
sprintf(name, bcm1480-counter %d, cpu);
cd-name= name;
cd-features= CLOCK_EVT_FEAT_PERIODIC |
- CLOCK_EVT_MODE_ONESHOT;
+ CLOCK_EVT_FEAT_ONESHOT;
clockevent_set_clock(cd, V_SCD_TIMER_FREQ);
cd-max_delta_ns= clockevent_delta2ns(0x7f, cd);
cd-min_delta_ns= clockevent_delta2ns(1, cd);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] time: Replace plat_timer_setup with modern APIs.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38760d40ca61b18b2809e9c28df8b3ff9af8a02b
Commit: 38760d40ca61b18b2809e9c28df8b3ff9af8a02b
Parent: 1238d5d868a56dcbc743d3ffc9bd3c920258b4cb
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 14:23:43 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] time: Replace plat_timer_setup with modern APIs.

plat_timer_setup is no longer getting called.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/cevt-r4k.c  |   25 
 arch/mips/mips-boards/generic/time.c |   52 ++---
 arch/mips/mipssim/sim_time.c |   52 ++---
 include/asm-mips/time.h  |1 +
 4 files changed, 63 insertions(+), 67 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index a59f67f..bab935a 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -224,7 +224,7 @@ void __cpuinit mips_clockevent_init(void)
uint64_t mips_freq = mips_hpt_frequency;
unsigned int cpu = smp_processor_id();
struct clock_event_device *cd;
-   unsigned int irq = MIPS_CPU_IRQ_BASE + 7;
+   unsigned int irq;
 
if (!cpu_has_counter || !mips_hpt_frequency)
return;
@@ -243,6 +243,15 @@ void __cpuinit mips_clockevent_init(void)
if (!c0_compare_int_usable())
return;
 
+   /*
+* With vectored interrupts things are getting platform specific.
+* get_c0_compare_int is a hook to allow a platform to return the
+* interrupt number of it's liking.
+*/
+   irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
+   if (get_c0_compare_int)
+   irq = get_c0_compare_int();
+
cd = per_cpu(mips_clockevent_device, cpu);
 
cd-name= MIPS;
@@ -267,13 +276,15 @@ void __cpuinit mips_clockevent_init(void)
 
clockevents_register_device(cd);
 
-   if (!cp0_timer_irq_installed) {
+   if (!cp0_timer_irq_installed)
+   return;
+
+   cp0_timer_irq_installed = 1;
+
 #ifdef CONFIG_MIPS_MT_SMTC
 #define CPUCTR_IMASKBIT (0x100  cp0_compare_irq)
-   setup_irq_smtc(irq, c0_compare_irqaction, CPUCTR_IMASKBIT);
+   setup_irq_smtc(irq, c0_compare_irqaction, CPUCTR_IMASKBIT);
 #else
-   setup_irq(irq, c0_compare_irqaction);
-#endif /* CONFIG_MIPS_MT_SMTC */
-   cp0_timer_irq_installed = 1;
-   }
+   setup_irq(irq, c0_compare_irqaction);
+#endif
 }
diff --git a/arch/mips/mips-boards/generic/time.c 
b/arch/mips/mips-boards/generic/time.c
index 9d6243a..f02ce63 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -127,26 +127,6 @@ unsigned long read_persistent_clock(void)
return mc146818_get_cmos_time();
 }
 
-void __init plat_time_init(void)
-{
-   unsigned int est_freq;
-
-/* Set Data mode - binary. */
-CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
-
-   est_freq = estimate_cpu_frequency();
-
-   printk(CPU frequency %d.%02d MHz\n, est_freq/100,
-  (est_freq%100)*100/100);
-
-cpu_khz = est_freq / 1000;
-
-   mips_scroll_message();
-#ifdef CONFIG_I8253/* Only Malta has a PIT */
-   setup_pit_timer();
-#endif
-}
-
 void __init plat_perf_setup(void)
 {
cp0_perfcount_irq = -1;
@@ -166,14 +146,13 @@ void __init plat_perf_setup(void)
}
 }
 
-void __init plat_timer_setup(struct irqaction *irq)
+unsigned int __init get_c0_compare_int(void)
 {
 #ifdef MSC01E_INT_BASE
if (cpu_has_veic) {
set_vi_handler(MSC01E_INT_CPUCTR, mips_timer_dispatch);
mips_cpu_timer_irq = MSC01E_INT_BASE + MSC01E_INT_CPUCTR;
-   }
-   else
+   } else
 #endif
{
if (cpu_has_vint)
@@ -181,13 +160,26 @@ void __init plat_timer_setup(struct irqaction *irq)
mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq;
}
 
-#ifdef CONFIG_MIPS_MT_SMTC
-   setup_irq_smtc(mips_cpu_timer_irq, irq, 0x100  cp0_compare_irq);
-#else
-   setup_irq(mips_cpu_timer_irq, irq);
-#endif /* CONFIG_MIPS_MT_SMTC */
-#ifdef CONFIG_SMP
-   set_irq_handler(mips_cpu_timer_irq, handle_percpu_irq);
+   return mips_cpu_timer_irq;
+}
+
+void __init plat_time_init(void)
+{
+   unsigned int est_freq;
+
+/* Set Data mode - binary. */
+CMOS_WRITE(CMOS_READ(RTC_CONTROL) | RTC_DM_BINARY, RTC_CONTROL);
+
+   est_freq = estimate_cpu_frequency();
+
+   printk(CPU frequency %d.%02d MHz\n, est_freq/100,
+  (est_freq%100)*100/100);
+
+cpu_khz = est_freq / 1000;
+
+   mips_scroll_message();
+#ifdef CONFIG_I8253/* Only Malta has a PIT */
+   setup_pit_timer();
 

[MIPS] Add len and addr validation for MAP_FIXED mappings.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=098362e72002d01fdd18afee2e635ffdcdc89e2c
Commit: 098362e72002d01fdd18afee2e635ffdcdc89e2c
Parent: c4e8308c30b0139f89bac71f3c22c8d7413b8665
Author: David Daney [EMAIL PROTECTED]
AuthorDate: Sat Oct 27 23:10:20 2007 -0700
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] Add len and addr validation for MAP_FIXED mappings.

Mmap with MAP_FIXED was not validating the addr and len parameters.  This
leads to the failure of GCC's gcc.c-torture/execute/loop-2[fg].c testcases
when using the o32 ABI on a 64 bit kernel.

These testcases try to mmap 65536 bytes at 0x7fff8000 and then access all
the memory.  In 2.6.18 and 2.6.23.1 (and likely other versions as well)
the kernel maps the requested memory, but since half of it is above
0x8000 a SIGBUS is generated when it is accessed.

This patch moves the len validation above the MAP_FIXED processing so that
it is always validated.  It also adds validation to the addr parameter for
MAP_FIXED mappings.

Signed-off-by: David Daney  [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/syscall.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index b95fe93..af1bdc8 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -73,7 +73,14 @@ unsigned long arch_get_unmapped_area(struct file *filp, 
unsigned long addr,
 
task_size = STACK_TOP;
 
+   if (len  task_size)
+   return -ENOMEM;
+
if (flags  MAP_FIXED) {
+   /* Even MAP_FIXED mappings must reside within task_size.  */
+   if (task_size - len  addr)
+   return -EINVAL;
+
/*
 * We do not accept a shared mapping if it would violate
 * cache aliasing constraints.
@@ -83,8 +90,6 @@ unsigned long arch_get_unmapped_area(struct file *filp, 
unsigned long addr,
return addr;
}
 
-   if (len  task_size)
-   return -ENOMEM;
do_color_align = 0;
if (filp || (flags  MAP_SHARED))
do_color_align = 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Alchemy: Register platform devices

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26c288f82c74dba08da6321c626c101a7aa8575b
Commit: 26c288f82c74dba08da6321c626c101a7aa8575b
Parent: 098362e72002d01fdd18afee2e635ffdcdc89e2c
Author: Florian Fainelli [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 18:55:55 2007 +0200
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] Alchemy: Register platform devices

This patch separates the platform devices registration for the MTX-1
specific devices: GPIO leds and watchdog.

[Minor fixup and formatting change -- Ralf]

Signed-off-by: Florian Fainelli [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/au1000/mtx-1/Makefile   |1 +
 arch/mips/au1000/mtx-1/platform.c |   86 +
 2 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/arch/mips/au1000/mtx-1/Makefile b/arch/mips/au1000/mtx-1/Makefile
index 764bf9f..afa7007 100644
--- a/arch/mips/au1000/mtx-1/Makefile
+++ b/arch/mips/au1000/mtx-1/Makefile
@@ -8,3 +8,4 @@
 #
 
 lib-y := init.o board_setup.o irqmap.o
+obj-y := platform.o
diff --git a/arch/mips/au1000/mtx-1/platform.c 
b/arch/mips/au1000/mtx-1/platform.c
new file mode 100644
index 000..01ebff6
--- /dev/null
+++ b/arch/mips/au1000/mtx-1/platform.c
@@ -0,0 +1,86 @@
+/*
+ * MTX-1 platform devices registration
+ *
+ * Copyright (C) 2007, Florian Fainelli [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/init.h
+#include linux/types.h
+#include linux/platform_device.h
+#include linux/leds.h
+
+#include asm/gpio.h
+
+static struct resource mtx1_wdt_res[] = {
+   [0] = {
+   .start  = 15,
+   .end= 15,
+   .name   = mtx1-wdt-gpio,
+   .flags  = IORESOURCE_IRQ,
+   }
+};
+
+static struct resource mtx1_sys_btn[] = {
+   [0] = {
+   .start  = 7,
+   .end= 7,
+   .name   = mtx1-sys-btn-gpio,
+   .flags  = IORESOURCE_IRQ,
+   }
+};
+
+static struct platform_device mtx1_wdt = {
+   .name = mtx1-wdt,
+   .id = 0,
+   .num_resources = ARRAY_SIZE(mtx1_wdt_res),
+   .resource = mtx1_wdt_res,
+};
+
+static struct gpio_led default_leds[] = {
+   {
+   .name   = mtx1:green,
+   .gpio = 211,
+   }, {
+   .name = mtx1:red,
+   .gpio = 212,
+   },
+};
+
+static struct gpio_led_platform_data mtx1_led_data = {
+   .num_leds = ARRAY_SIZE(default_leds),
+   .leds = default_leds,
+};
+
+static struct platform_device mtx1_gpio_leds = {
+   .name = leds-gpio,
+   .id = -1,
+   .dev = {
+   .platform_data = mtx1_led_data,
+   }
+};
+
+static struct __initdata platform_device * mtx1_devs[] = {
+   mtx1_gpio_leds,
+   mtx1_wdt
+};
+
+static int __init mtx1_register_devices(void)
+{
+   return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs));
+}
+
+arch_initcall(mtx1_register_devices);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Store sign-extend register values for PTRACE_GETREGS

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=62b14c24b10033591bbab16dea165d696a616f37
Commit: 62b14c24b10033591bbab16dea165d696a616f37
Parent: 26c288f82c74dba08da6321c626c101a7aa8575b
Author: Atsushi Nemoto [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 00:53:02 2007 +0900
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] Store sign-extend register values for PTRACE_GETREGS

A comment on ptrace_getregs() states Registers are sign extended to
fill the available space. but it is not true.  Fix code to match the
comment.  Also fix casts on each caller to get rid of some warnings.

Signed-off-by: Atsushi Nemoto [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/ptrace.c   |   18 +-
 arch/mips/kernel/ptrace32.c |4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index 999f785..35234b9 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -65,13 +65,13 @@ int ptrace_getregs(struct task_struct *child, __s64 __user 
*data)
regs = task_pt_regs(child);
 
for (i = 0; i  32; i++)
-   __put_user(regs-regs[i], data + i);
-   __put_user(regs-lo, data + EF_LO - EF_R0);
-   __put_user(regs-hi, data + EF_HI - EF_R0);
-   __put_user(regs-cp0_epc, data + EF_CP0_EPC - EF_R0);
-   __put_user(regs-cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
-   __put_user(regs-cp0_status, data + EF_CP0_STATUS - EF_R0);
-   __put_user(regs-cp0_cause, data + EF_CP0_CAUSE - EF_R0);
+   __put_user((long)regs-regs[i], data + i);
+   __put_user((long)regs-lo, data + EF_LO - EF_R0);
+   __put_user((long)regs-hi, data + EF_HI - EF_R0);
+   __put_user((long)regs-cp0_epc, data + EF_CP0_EPC - EF_R0);
+   __put_user((long)regs-cp0_badvaddr, data + EF_CP0_BADVADDR - EF_R0);
+   __put_user((long)regs-cp0_status, data + EF_CP0_STATUS - EF_R0);
+   __put_user((long)regs-cp0_cause, data + EF_CP0_CAUSE - EF_R0);
 
return 0;
 }
@@ -390,11 +390,11 @@ long arch_ptrace(struct task_struct *child, long request, 
long addr, long data)
}
 
case PTRACE_GETREGS:
-   ret = ptrace_getregs(child, (__u64 __user *) data);
+   ret = ptrace_getregs(child, (__s64 __user *) data);
break;
 
case PTRACE_SETREGS:
-   ret = ptrace_setregs(child, (__u64 __user *) data);
+   ret = ptrace_setregs(child, (__s64 __user *) data);
break;
 
case PTRACE_GETFPREGS:
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index f2bffed..76818be 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -346,11 +346,11 @@ asmlinkage int sys32_ptrace(int request, int pid, int 
addr, int data)
}
 
case PTRACE_GETREGS:
-   ret = ptrace_getregs(child, (__u64 __user *) (__u64) data);
+   ret = ptrace_getregs(child, (__s64 __user *) (__u64) data);
break;
 
case PTRACE_SETREGS:
-   ret = ptrace_setregs(child, (__u64 __user *) (__u64) data);
+   ret = ptrace_setregs(child, (__s64 __user *) (__u64) data);
break;
 
case PTRACE_GETFPREGS:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] c-r3k: Implement flush_cache_range()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=21b2aecaae3a46a13dbe775639e7d060bec033bd
Commit: 21b2aecaae3a46a13dbe775639e7d060bec033bd
Parent: 62b14c24b10033591bbab16dea165d696a616f37
Author: Maciej W. Rozycki [EMAIL PROTECTED]
AuthorDate: Wed Oct 17 11:51:39 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] c-r3k: Implement flush_cache_range()

Contrary to the belief of some, the R3000 and related processors did have
caches, both a data and an instruction cache.  Here is an implementation
of r3k_flush_cache_page(), which is the processor-specific back-end for
flush_cache_range(), done according to the spec in
Documentation/cachetlb.txt.

While at it, remove an unused local function: get_phys_page(), do some
trivial formatting fixes and modernise debugging facilities.

Signed-off-by: Maciej W. Rozycki [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/mm/c-r3k.c |   60 ++---
 1 files changed, 32 insertions(+), 28 deletions(-)

diff --git a/arch/mips/mm/c-r3k.c b/arch/mips/mm/c-r3k.c
index c55312f..562abb7 100644
--- a/arch/mips/mm/c-r3k.c
+++ b/arch/mips/mm/c-r3k.c
@@ -7,7 +7,7 @@
  * Tx39XX R4k style caches added. HK
  * Copyright (C) 1998, 1999, 2000 Harald Koerfgen
  * Copyright (C) 1998 Gleb Raiko  Vladimir Roganov
- * Copyright (C) 2001, 2004  Maciej W. Rozycki
+ * Copyright (C) 2001, 2004, 2007  Maciej W. Rozycki
  */
 #include linux/init.h
 #include linux/kernel.h
@@ -26,8 +26,6 @@
 static unsigned long icache_size, dcache_size; /* Size in bytes */
 static unsigned long icache_lsize, dcache_lsize;   /* Size in bytes */
 
-#undef DEBUG_CACHE
-
 unsigned long __init r3k_cache_size(unsigned long ca_flags)
 {
unsigned long flags, status, dummy, size;
@@ -217,26 +215,6 @@ static void r3k_flush_dcache_range(unsigned long start, 
unsigned long end)
write_c0_status(flags);
 }
 
-static inline unsigned long get_phys_page(unsigned long addr,
- struct mm_struct *mm)
-{
-   pgd_t *pgd;
-   pud_t *pud;
-   pmd_t *pmd;
-   pte_t *pte;
-   unsigned long physpage;
-
-   pgd = pgd_offset(mm, addr);
-   pud = pud_offset(pgd, addr);
-   pmd = pmd_offset(pud, addr);
-   pte = pte_offset(pmd, addr);
-
-   if ((physpage = pte_val(*pte))  _PAGE_VALID)
-   return KSEG0ADDR(physpage  PAGE_MASK);
-
-   return 0;
-}
-
 static inline void r3k_flush_cache_all(void)
 {
 }
@@ -252,12 +230,40 @@ static void r3k_flush_cache_mm(struct mm_struct *mm)
 }
 
 static void r3k_flush_cache_range(struct vm_area_struct *vma,
-   unsigned long start, unsigned long end)
+ unsigned long start, unsigned long end)
 {
 }
 
-static void r3k_flush_cache_page(struct vm_area_struct *vma, unsigned long 
page, unsigned long pfn)
+static void r3k_flush_cache_page(struct vm_area_struct *vma,
+unsigned long addr, unsigned long pfn)
 {
+   unsigned long kaddr = KSEG0ADDR(pfn  PAGE_SHIFT);
+   int exec = vma-vm_flags  VM_EXEC;
+   struct mm_struct *mm = vma-vm_mm;
+   pgd_t *pgdp;
+   pud_t *pudp;
+   pmd_t *pmdp;
+   pte_t *ptep;
+
+   pr_debug(cpage[%08lx,%08lx]\n,
+cpu_context(smp_processor_id(), mm), addr);
+
+   /* No ASID = no such page in the cache.  */
+   if (cpu_context(smp_processor_id(), mm) == 0)
+   return;
+
+   pgdp = pgd_offset(mm, addr);
+   pudp = pud_offset(pgdp, addr);
+   pmdp = pmd_offset(pudp, addr);
+   ptep = pte_offset(pmdp, addr);
+
+   /* Invalid = no such page in the cache.  */
+   if (!(pte_val(*ptep)  _PAGE_PRESENT))
+   return;
+
+   r3k_flush_dcache_range(kaddr, kaddr + PAGE_SIZE);
+   if (exec)
+   r3k_flush_icache_range(kaddr, kaddr + PAGE_SIZE);
 }
 
 static void local_r3k_flush_data_cache_page(void *addr)
@@ -272,9 +278,7 @@ static void r3k_flush_cache_sigtramp(unsigned long addr)
 {
unsigned long flags;
 
-#ifdef DEBUG_CACHE
-   printk(csigtramp[%08lx], addr);
-#endif
+   pr_debug(csigtramp[%08lx]\n, addr);
 
flags = read_c0_status();
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] vmlinux.ld.S: correctly indent .data section

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=16be243589934f5e76f7fc2c3eb65c9909d56f93
Commit: 16be243589934f5e76f7fc2c3eb65c9909d56f93
Parent: 21b2aecaae3a46a13dbe775639e7d060bec033bd
Author: Franck Bui-Huu [EMAIL PROTECTED]
AuthorDate: Thu Oct 18 23:12:32 2007 +0200
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

[MIPS] vmlinux.ld.S: correctly indent .data section

Signed-off-by: Franck Bui-Huu [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/vmlinux.lds.S |   32 +---
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 2781cff..5fc2398 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -63,21 +63,23 @@ SECTIONS
 
/* writeable */
.data : {   /* Data */
- . = . + DATAOFFSET;   /* for CONFIG_MAPPED_KERNEL */
- /*
-  * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 
which
-  * limits the maximum alignment to at most 32kB and results in the 
following
-  * warning:
-  *
-  *  CC  arch/mips/kernel/init_task.o
-  * arch/mips/kernel/init_task.c:30: warning: alignment of 
‘init_thread_union’
-  * is greater than maximum object file alignment.  Using 32768
-  */
- . = ALIGN(_PAGE_SIZE);
- *(.data.init_task)
-
- DATA_DATA
- CONSTRUCTORS
+   . = . + DATAOFFSET; /* for CONFIG_MAPPED_KERNEL */
+   /*
+* This ALIGN is needed as a workaround for a bug a
+* gcc bug upto 4.1 which limits the maximum alignment
+* to at most 32kB and results in the following
+* warning:
+*
+*  CC  arch/mips/kernel/init_task.o
+* arch/mips/kernel/init_task.c:30: warning: alignment
+* of ‘init_thread_union’ is greater than maximum
+* object file alignment.  Using 32768
+*/
+   . = ALIGN(_PAGE_SIZE);
+   *(.data.init_task)
+
+   DATA_DATA
+   CONSTRUCTORS
}
_gp = . + 0x8000;
.lit8 : {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] sb1250: Enable GenBus IDE in defconfig.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9ba26a93a691df24fa520dc47ee9f6f05014bf1
Commit: d9ba26a93a691df24fa520dc47ee9f6f05014bf1
Parent: 16be243589934f5e76f7fc2c3eb65c9909d56f93
Author: Maciej W. Rozycki [EMAIL PROTECTED]
AuthorDate: Fri Oct 12 16:46:56 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

[MIPS] sb1250: Enable GenBus IDE in defconfig.

Enable the onboard GenBus IDE interface in the default configuration.

Signed-off-by: Maciej W. Rozycki [EMAIL PROTECTED]
Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/configs/sb1250-swarm_defconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/configs/sb1250-swarm_defconfig 
b/arch/mips/configs/sb1250-swarm_defconfig
index 49dfcef..c279822 100644
--- a/arch/mips/configs/sb1250-swarm_defconfig
+++ b/arch/mips/configs/sb1250-swarm_defconfig
@@ -468,7 +468,7 @@ CONFIG_BLK_DEV_IDEFLOPPY=y
 #
 CONFIG_IDE_GENERIC=y
 # CONFIG_BLK_DEV_IDEPCI is not set
-# CONFIG_BLK_DEV_IDE_SWARM is not set
+CONFIG_BLK_DEV_IDE_SWARM=y
 # CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
 # CONFIG_IDEDMA_AUTO is not set
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Author: Ralf Baechle [EMAIL PROTECTED]

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1553f6a2ca53b0d723f21d915fdd3d2cf7c8f852
Commit: 1553f6a2ca53b0d723f21d915fdd3d2cf7c8f852
Parent: d9ba26a93a691df24fa520dc47ee9f6f05014bf1
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Tue Oct 9 15:15:21 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

Author: Ralf Baechle [EMAIL PROTECTED]

[MIPS] MSP71xx: Fix bitrot.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/pci/fixup-pmcmsp.c  |2 +-
 arch/mips/pci/ops-pmcmsp.c|2 +-
 arch/mips/pmc-sierra/msp71xx/msp_serial.c |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/pci/fixup-pmcmsp.c b/arch/mips/pci/fixup-pmcmsp.c
index 0026121..65735b1 100644
--- a/arch/mips/pci/fixup-pmcmsp.c
+++ b/arch/mips/pci/fixup-pmcmsp.c
@@ -202,7 +202,7 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
  *  RETURNS: IRQ number
  *
  /
-int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
+int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
 #if !defined(CONFIG_PMC_MSP7120_GW)  !defined(CONFIG_PMC_MSP7120_EVAL)
printk(KERN_WARNING PCI: unknown board, no PCI IRQs assigned.\n);
diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c
index 059eade..109c95c 100644
--- a/arch/mips/pci/ops-pmcmsp.c
+++ b/arch/mips/pci/ops-pmcmsp.c
@@ -404,7 +404,7 @@ int msp_pcibios_config_access(unsigned char access_type,
if (pciirqflag == 0) {
request_irq(MSP_INT_PCI,/* Hardcoded internal MSP7120 wiring */
bpci_interrupt,
-   SA_SHIRQ | SA_INTERRUPT,
+   IRQF_SHARED | IRQF_DISABLED,
PMC MSP PCI Host,
preg);
pciirqflag = ~0;
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_serial.c 
b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
index 15e7b80..9de3430 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_serial.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_serial.c
@@ -122,7 +122,7 @@ void __init msp_serial_setup(void)
up.uartclk  = uartclk;
up.regshift = 2;
up.iotype   = UPIO_DWAPB; /* UPIO_MEM like */
-   up.flags= STD_COM_FLAGS;
+   up.flags= ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST;
up.type = PORT_16550A;
up.line = 0;
up.private_data = (void*)UART0_STATUS_REG;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Alchemy: Remove CONFIG_TS_AU1X00_ADS7846 from defconfigs.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a370605594bc9f375d2912096f01643c46b4b709
Commit: a370605594bc9f375d2912096f01643c46b4b709
Parent: 1553f6a2ca53b0d723f21d915fdd3d2cf7c8f852
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 19:35:37 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

[MIPS] Alchemy: Remove CONFIG_TS_AU1X00_ADS7846 from defconfigs.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/configs/db1000_defconfig |1 -
 arch/mips/configs/db1100_defconfig |1 -
 arch/mips/configs/db1200_defconfig |1 -
 arch/mips/configs/db1500_defconfig |1 -
 arch/mips/configs/db1550_defconfig |1 -
 arch/mips/configs/pb1100_defconfig |1 -
 arch/mips/configs/pb1500_defconfig |1 -
 arch/mips/configs/pb1550_defconfig |1 -
 8 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/arch/mips/configs/db1000_defconfig 
b/arch/mips/configs/db1000_defconfig
index 885b633..5a8b7ac 100644
--- a/arch/mips/configs/db1000_defconfig
+++ b/arch/mips/configs/db1000_defconfig
@@ -738,7 +738,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/db1100_defconfig 
b/arch/mips/configs/db1100_defconfig
index e3c3a07..d4ed90b 100644
--- a/arch/mips/configs/db1100_defconfig
+++ b/arch/mips/configs/db1100_defconfig
@@ -714,7 +714,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/db1200_defconfig 
b/arch/mips/configs/db1200_defconfig
index 9aa7c3e..a055657 100644
--- a/arch/mips/configs/db1200_defconfig
+++ b/arch/mips/configs/db1200_defconfig
@@ -775,7 +775,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/db1500_defconfig 
b/arch/mips/configs/db1500_defconfig
index 9924066..0ad08cf 100644
--- a/arch/mips/configs/db1500_defconfig
+++ b/arch/mips/configs/db1500_defconfig
@@ -811,7 +811,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/db1550_defconfig 
b/arch/mips/configs/db1550_defconfig
index 19992f7..057c7d4 100644
--- a/arch/mips/configs/db1550_defconfig
+++ b/arch/mips/configs/db1550_defconfig
@@ -856,7 +856,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/pb1100_defconfig 
b/arch/mips/configs/pb1100_defconfig
index d53fa8f..703d28d 100644
--- a/arch/mips/configs/pb1100_defconfig
+++ b/arch/mips/configs/pb1100_defconfig
@@ -731,7 +731,6 @@ CONFIG_HW_CONSOLE=y
 CONFIG_VT_HW_CONSOLE_BINDING=y
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/pb1500_defconfig 
b/arch/mips/configs/pb1500_defconfig
index dc4aa0c..82f0c5c 100644
--- a/arch/mips/configs/pb1500_defconfig
+++ b/arch/mips/configs/pb1500_defconfig
@@ -849,7 +849,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
diff --git a/arch/mips/configs/pb1550_defconfig 
b/arch/mips/configs/pb1550_defconfig
index 24428e1..147a4fc 100644
--- a/arch/mips/configs/pb1550_defconfig
+++ b/arch/mips/configs/pb1550_defconfig
@@ -842,7 +842,6 @@ CONFIG_SERIO_RAW=m
 # CONFIG_VT is not set
 # CONFIG_SERIAL_NONSTANDARD is not set
 # CONFIG_AU1X00_GPIO is not set
-# CONFIG_TS_AU1X00_ADS7846 is not set
 
 #
 # Serial drivers
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] MT: Fix bug in multithreaded kernels.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a76ab5c10d99bdf458067cb495e72c0ee5f09909
Commit: a76ab5c10d99bdf458067cb495e72c0ee5f09909
Parent: a370605594bc9f375d2912096f01643c46b4b709
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 8 16:38:37 2007 +0100
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

[MIPS] MT: Fix bug in multithreaded kernels.

When GDB writes a breakpoint into address area of inferior process the
kernel needs to invalidate the modified memory in the inferior which
is done by calling flush_cache_page which in turns calls
r4k_flush_cache_page and local_r4k_flush_cache_page for VSMP or SMTC
kernel via r4k_on_each_cpu().

As the VSMP and SMTC SMP kernels for 34K are running on a single shared
caches it is possible to get away without interprocessor function calls.
This optimization is implemented in r4k_on_each_cpu, so
local_r4k_flush_cache_page is only ever called on the local CPU.

This is where the following code in local_r4k_flush_cache_page() strikes:

/*
 * If ownes no valid ASID yet, cannot possibly have gotten
 * this page into the cache.
 */
if (cpu_context(smp_processor_id(), mm) == 0)
return;

On VSMP and SMTC had a function of cpu_context() for each CPU(TC).

So in case another CPU than the CPU executing local_r4k_cache_flush_page
has not accessed the mm but one of the other CPUs has there may be data
to be flushed in the cache yet local_r4k_cache_flush_page will falsely
return leaving the I-cache inconsistent for the breakpoint.

While the issue was discovered with GDB it also exists in
local_r4k_flush_cache_range() and local_r4k_flush_cache().

Fixed by introducing a new function has_valid_asid which on MT kernels
returns true if a mm is active on any processor in the system.

This is relativly expensive since for memory acccesses in that loop
cache misses have to be assumed but it seems the most viable solution
for 2.6.23 and older -stable kernels.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/mm/c-r4k.c |   21 ++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index d708833..6806d58 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -345,11 +345,26 @@ static void r4k___flush_cache_all(void)
r4k_on_each_cpu(local_r4k___flush_cache_all, NULL, 1, 1);
 }
 
+static inline int has_valid_asid(const struct mm_struct *mm)
+{
+#if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
+   int i;
+
+   for_each_online_cpu(i)
+   if (cpu_context(i, mm))
+   return 1;
+
+   return 0;
+#else
+   return cpu_context(smp_processor_id(), mm);
+#endif
+}
+
 static inline void local_r4k_flush_cache_range(void * args)
 {
struct vm_area_struct *vma = args;
 
-   if (!(cpu_context(smp_processor_id(), vma-vm_mm)))
+   if (!(has_valid_asid(vma-vm_mm)))
return;
 
r4k_blast_dcache();
@@ -368,7 +383,7 @@ static inline void local_r4k_flush_cache_mm(void * args)
 {
struct mm_struct *mm = args;
 
-   if (!cpu_context(smp_processor_id(), mm))
+   if (!has_valid_asid(mm))
return;
 
/*
@@ -420,7 +435,7 @@ static inline void local_r4k_flush_cache_page(void *args)
 * If ownes no valid ASID yet, cannot possibly have gotten
 * this page into the cache.
 */
-   if (cpu_context(smp_processor_id(), mm) == 0)
+   if (!has_valid_asid(mm))
return;
 
addr = PAGE_MASK;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] tb0219: Update copyright message.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a3b7920fe55247d39c3e1ac1e9b8aca607d0188
Commit: 1a3b7920fe55247d39c3e1ac1e9b8aca607d0188
Parent: a76ab5c10d99bdf458067cb495e72c0ee5f09909
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 19:35:37 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:37 2007 +

[MIPS] tb0219: Update copyright message.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/pci/fixup-tb0219.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/pci/fixup-tb0219.c b/arch/mips/pci/fixup-tb0219.c
index 720a2b7..ed87733 100644
--- a/arch/mips/pci/fixup-tb0219.c
+++ b/arch/mips/pci/fixup-tb0219.c
@@ -2,7 +2,7 @@
  *  fixup-tb0219.c, The TANBAC TB0219 specific PCI fixups.
  *
  *  Copyright (C) 2003  Megasolution Inc. [EMAIL PROTECTED]
- *  Copyright (C) 2004  Yoichi Yuasa [EMAIL PROTECTED]
+ *  Copyright (C) 2004-2005  Yoichi Yuasa [EMAIL PROTECTED]
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] IRIX: Fix off-by-one error in signal compat code.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4e8308c30b0139f89bac71f3c22c8d7413b8665
Commit: c4e8308c30b0139f89bac71f3c22c8d7413b8665
Parent: 38760d40ca61b18b2809e9c28df8b3ff9af8a02b
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 15:00:37 2007 +
Committer:  Ralf Baechle [EMAIL PROTECTED]
CommitDate: Mon Oct 29 19:35:36 2007 +

[MIPS] IRIX: Fix off-by-one error in signal compat code.

Based on original patch by Roel Kluin [EMAIL PROTECTED].

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
---
 arch/mips/kernel/irixsig.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c
index a0a9105..33506ff 100644
--- a/arch/mips/kernel/irixsig.c
+++ b/arch/mips/kernel/irixsig.c
@@ -24,8 +24,12 @@
 
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
+#define _IRIX_NSIG 128
+#define _IRIX_NSIG_BPW BITS_PER_LONG
+#define _IRIX_NSIG_WORDS   (_IRIX_NSIG / _IRIX_NSIG_BPW)
+
 typedef struct {
-   unsigned long sig[4];
+   unsigned long sig[_IRIX_NSIG_WORDS];
 } irix_sigset_t;
 
 struct sigctx_irix5 {
@@ -527,7 +531,7 @@ asmlinkage int irix_sigpoll_sys(unsigned long __user *set,
 
expire = schedule_timeout_interruptible(expire);
 
-   for (i=0; i=4; i++)
+   for (i=0; i  _IRIX_NSIG_WORDS; i++)
tmp |= (current-pending.signal.sig[i]  kset.sig[i]);
 
if (tmp)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


libata: relocate forcing PIO0 on reset

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cdeab1140799f09c5f728a5ff85e0bdfa5679cd2
Commit: cdeab1140799f09c5f728a5ff85e0bdfa5679cd2
Parent: a9efacbad1a735ec410acb26c9de72be8efb33d5
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 16:41:09 2007 +0900
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:21:33 2007 -0400

libata: relocate forcing PIO0 on reset

Forcing PIO0 on reset was done inside ata_bus_softreset(), which is a
bit out of place as it should be applied to all resets - hard, soft
and implementation which don't use ata_bus_softreset().  Relocate it
such that...

* For new EH, it's done in ata_eh_reset() before calling prereset.

* For old EH, it's done before calling ap-ops-phy_reset() in
  ata_bus_probe().

This makes PIO0 forced after all resets.  Another difference is that
reset itself is done after PIO0 is forced.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Acked-by: Alan Cox [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/libata-core.c |   46 ++--
 drivers/ata/libata-eh.c   |   19 ++
 2 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8ee56e5..bdd8778 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2219,6 +2219,25 @@ int ata_bus_probe(struct ata_port *ap)
tries[dev-devno] = ATA_PROBE_MAX_TRIES;
 
  retry:
+   ata_link_for_each_dev(dev, ap-link) {
+   /* If we issue an SRST then an ATA drive (not ATAPI)
+* may change configuration and be in PIO0 timing. If
+* we do a hard reset (or are coming from power on)
+* this is true for ATA or ATAPI. Until we've set a
+* suitable controller mode we should not touch the
+* bus as we may be talking too fast.
+*/
+   dev-pio_mode = XFER_PIO_0;
+
+   /* If the controller has a pio mode setup function
+* then use it to set the chipset to rights. Don't
+* touch the DMA setup as that will be dealt with when
+* configuring devices.
+*/
+   if (ap-ops-set_piomode)
+   ap-ops-set_piomode(ap, dev);
+   }
+
/* reset and determine device classes */
ap-ops-phy_reset(ap);
 
@@ -2234,12 +2253,6 @@ int ata_bus_probe(struct ata_port *ap)
 
ata_port_probe(ap);
 
-   /* after the reset the device state is PIO 0 and the controller
-  state is undefined. Record the mode */
-
-   ata_link_for_each_dev(dev, ap-link)
-   dev-pio_mode = XFER_PIO_0;
-
/* read IDENTIFY page and configure devices. We have to do the identify
   specific sequence bass-ackwards so that PDIAG- is released by
   the slave device */
@@ -3272,8 +3285,6 @@ static int ata_bus_softreset(struct ata_port *ap, 
unsigned int devmask,
 unsigned long deadline)
 {
struct ata_ioports *ioaddr = ap-ioaddr;
-   struct ata_device *dev;
-   int i = 0;
 
DPRINTK(ata%u: bus reset via SRST\n, ap-print_id);
 
@@ -3284,25 +3295,6 @@ static int ata_bus_softreset(struct ata_port *ap, 
unsigned int devmask,
udelay(20); /* FIXME: flush */
iowrite8(ap-ctl, ioaddr-ctl_addr);
 
-   /* If we issued an SRST then an ATA drive (not ATAPI)
-* may have changed configuration and be in PIO0 timing. If
-* we did a hard reset (or are coming from power on) this is
-* true for ATA or ATAPI. Until we've set a suitable controller
-* mode we should not touch the bus as we may be talking too fast.
-*/
-
-   ata_link_for_each_dev(dev, ap-link)
-   dev-pio_mode = XFER_PIO_0;
-
-   /* If the controller has a pio mode setup function then use
-  it to set the chipset to rights. Don't touch the DMA setup
-  as that will be dealt with when revalidating */
-   if (ap-ops-set_piomode) {
-   ata_link_for_each_dev(dev, ap-link)
-   if (devmask  (1  i++))
-   ap-ops-set_piomode(ap, dev);
-   }
-
/* wait a while before checking status */
ata_wait_after_reset(ap, deadline);
 
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 496edaf..b237ff1 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2083,6 +2083,25 @@ int ata_eh_reset(struct ata_link *link, int classify,
 
ata_eh_about_to_do(link, NULL, ehc-i.action  ATA_EH_RESET_MASK);
 
+   ata_link_for_each_dev(dev, link) {
+   /* If we issue an SRST then an ATA drive (not ATAPI)
+* may change configuration and be in PIO0 timing. If
+  

libata: implement ata_wait_after_reset()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=88ff6eafbb2a1c55f0f0e2e16d72e7b10d8ae8a5
Commit: 88ff6eafbb2a1c55f0f0e2e16d72e7b10d8ae8a5
Parent: 054a5fbaceb2eb3a31ea843c1cf0b8e10b91478c
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Tue Oct 16 14:21:24 2007 -0700
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:15:27 2007 -0400

libata: implement ata_wait_after_reset()

On certain device/controller combination, 0xff status is asserted
after reset and doesn't get cleared during 150ms post-reset wait.  As
0xff status is interpreted as no device (for good reasons), this can
lead to misdetection on such cases.

This patch implements ata_wait_after_reset() which replaces the 150ms
sleep and waits upto ATA_TMOUT_FF_WAIT if status is 0xff.
ATA_TMOUT_FF_WAIT is currently 800ms which is enough for
HHD424020F7SV00 to get detected but not enough for Quantum GoVault
drive which is known to take upto 2s.

Without parallel probing, spending 2s on 0xff port would incur too
much delay on ata_piix's which use 0xff to indicate empty port and
doesn't have SCR register, so GoVault needs to wait till parallel
probing.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/ata/ahci.c  |   11 +--
 drivers/ata/libata-core.c   |   67 ++
 drivers/ata/pata_scc.c  |   13 +---
 drivers/ata/sata_inic162x.c |2 +-
 include/linux/libata.h  |8 +
 5 files changed, 67 insertions(+), 34 deletions(-)

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 49cf4cf..93bcb2c 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1153,15 +1153,8 @@ static int ahci_do_softreset(struct ata_link *link, 
unsigned int *class,
tf.ctl = ~ATA_SRST;
ahci_exec_polled_cmd(ap, pmp, tf, 0, 0, 0);
 
-   /* spec mandates = 2ms before checking status.
-* We wait 150ms, because that was the magic delay used for
-* ATAPI devices in Hale Landis's ATADRVR, for the period of time
-* between when the ATA command register is written, and then
-* status is checked.  Because waiting for a while before
-* checking status is fine, post SRST, we perform this magic
-* delay here as well.
-*/
-   msleep(150);
+   /* wait a while before checking status */
+   ata_wait_after_reset(ap, deadline);
 
rc = ata_wait_ready(ap, deadline);
/* link occupied, -ENODEV too is an error */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 50ae201..8ee56e5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3118,6 +3118,55 @@ int ata_busy_sleep(struct ata_port *ap,
 }
 
 /**
+ * ata_wait_after_reset - wait before checking status after reset
+ * @ap: port containing status register to be polled
+ * @deadline: deadline jiffies for the operation
+ *
+ * After reset, we need to pause a while before reading status.
+ * Also, certain combination of controller and device report 0xff
+ * for some duration (e.g. until SATA PHY is up and running)
+ * which is interpreted as empty port in ATA world.  This
+ * function also waits for such devices to get out of 0xff
+ * status.
+ *
+ * LOCKING:
+ * Kernel thread context (may sleep).
+ */
+void ata_wait_after_reset(struct ata_port *ap, unsigned long deadline)
+{
+   unsigned long until = jiffies + ATA_TMOUT_FF_WAIT;
+
+   if (time_before(until, deadline))
+   deadline = until;
+
+   /* Spec mandates = 2ms before checking status.  We wait
+* 150ms, because that was the magic delay used for ATAPI
+* devices in Hale Landis's ATADRVR, for the period of time
+* between when the ATA command register is written, and then
+* status is checked.  Because waiting for a while before
+* checking status is fine, post SRST, we perform this magic
+* delay here as well.
+*
+* Old drivers/ide uses the 2mS rule and then waits for ready.
+*/
+   msleep(150);
+
+   /* Wait for 0xff to clear.  Some SATA devices take a long time
+* to clear 0xff after reset.  For example, HHD424020F7SV00
+* iVDR needs = 800ms while.  Quantum GoVault needs even more
+* than that.
+*/
+   while (1) {
+   u8 status = ata_chk_status(ap);
+
+   if (status != 0xff || time_after(jiffies, deadline))
+   return;
+
+   msleep(50);
+   }
+}
+
+/**
  * ata_wait_ready - sleep until BSY clears, or timeout
  * @ap: port containing status register to be polled
  * @deadline: deadline jiffies for the operation
@@ -3254,17 +3303,8 @@ static int ata_bus_softreset(struct ata_port 

Fix ethernet multicast for ucc_geth.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9030b3dd671d672f5fcc91c2ec48f02082310af4
Commit: 9030b3dd671d672f5fcc91c2ec48f02082310af4
Parent: 5e7bf8cc60d29354305cc76daa21a7d92745521c
Author: Joakim Tjernlund [EMAIL PROTECTED]
AuthorDate: Wed Oct 17 11:05:41 2007 +0200
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 06:11:11 2007 -0400

Fix ethernet multicast for ucc_geth.

hw_add_addr_in_hash() already swaps byte
order, don't do it in ucc_geth_set_multi() too.

Signed-off-by: Joakim Tjernlund [EMAIL PROTECTED]
Acked-by: ucc_geth maintainer
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/ucc_geth.c |   15 ++-
 1 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 9741d61..a3ff270 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -2214,9 +2214,7 @@ static void ucc_geth_set_multi(struct net_device *dev)
struct dev_mc_list *dmi;
struct ucc_fast *uf_regs;
struct ucc_geth_82xx_address_filtering_pram *p_82xx_addr_filt;
-   u8 tempaddr[6];
-   u8 *mcptr, *tdptr;
-   int i, j;
+   int i;
 
ugeth = netdev_priv(dev);
 
@@ -2255,19 +2253,10 @@ static void ucc_geth_set_multi(struct net_device *dev)
if (!(dmi-dmi_addr[0]  1))
continue;
 
-   /* The address in dmi_addr is LSB first,
-* and taddr is MSB first.  We have to
-* copy bytes MSB first from dmi_addr.
-*/
-   mcptr = (u8 *) dmi-dmi_addr + 5;
-   tdptr = (u8 *) tempaddr;
-   for (j = 0; j  6; j++)
-   *tdptr++ = *mcptr--;
-
/* Ask CPM to run CRC and set bit in
 * filter mask.
 */
-   hw_add_addr_in_hash(ugeth, tempaddr);
+   hw_add_addr_in_hash(ugeth, dmi-dmi_addr);
}
}
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iwl3945: cancel scan on rxon command

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15e869d86ee349f5510cf93f6b61e3a5e415c35f
Commit: 15e869d86ee349f5510cf93f6b61e3a5e415c35f
Parent: 948c171cfe9c63102cfb530af8a4b64e9643dde9
Author: Mohamed Abbas [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 17:15:46 2007 +0800
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:24:48 2007 -0400

[PATCH] iwl3945: cancel scan on rxon command

This patch fixes the following for 3945:
1. Make sure we cancel scan if RXON command is called.
2. Call scan abort on scan watchdog.

Signed-off-by: Mohamed Abbas [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   24 
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 83019d1..f1e1939 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6478,8 +6478,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
  Scan completion watchdog resetting adapter (%dms)\n,
  jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
+
if (!test_bit(STATUS_EXIT_PENDING, priv-status))
-   queue_work(priv-workqueue, priv-restart);
+   iwl_send_scan_abort(priv);
}
mutex_unlock(priv-mutex);
 }
@@ -6575,7 +6576,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
spin_unlock_irqrestore(priv-lock, flags);
 
scan-suspend_time = 0;
-   scan-max_out_time = cpu_to_le32(600 * 1024);
+   scan-max_out_time = cpu_to_le32(200 * 1024);
if (!interval)
interval = suspend_time;
/*
@@ -6744,6 +6745,8 @@ static void iwl_bg_post_associate(struct work_struct 
*data)
 
mutex_lock(priv-mutex);
 
+   iwl_scan_cancel_timeout(priv, 200);
+
conf = ieee80211_get_hw_conf(priv-hw);
 
priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
@@ -7169,8 +7172,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw 
*hw, int if_id,
if (priv-iw_mode == IEEE80211_IF_TYPE_AP)
iwl_config_ap(priv);
else {
-   priv-staging_rxon.filter_flags |=
-   RXON_FILTER_ASSOC_MSK;
rc = iwl_commit_rxon(priv);
if ((priv-iw_mode == IEEE80211_IF_TYPE_STA)  rc)
iwl_add_station(priv,
@@ -7178,6 +7179,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw 
*hw, int if_id,
}
 
} else {
+   iwl_scan_cancel_timeout(priv, 100);
priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
iwl_commit_rxon(priv);
}
@@ -7238,6 +7240,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
 
IWL_DEBUG_MAC80211(enter\n);
 
+   mutex_lock(priv-mutex);
spin_lock_irqsave(priv-lock, flags);
 
if (!iwl_is_ready_rf(priv)) {
@@ -7276,6 +7279,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
 
 out_unlock:
spin_unlock_irqrestore(priv-lock, flags);
+   mutex_unlock(priv-mutex);
 
return rc;
 }
@@ -7310,6 +7314,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
 
mutex_lock(priv-mutex);
 
+   iwl_scan_cancel_timeout(priv, 100);
+
switch (cmd) {
case  SET_KEY:
rc = iwl_update_sta_key_info(priv, key, sta_id);
@@ -7479,8 +7485,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
 
spin_unlock_irqrestore(priv-lock, flags);
 
+   /* we are restarting association process
+* clear RXON_FILTER_ASSOC_MSK bit
+   */
+   if (priv-iw_mode != IEEE80211_IF_TYPE_AP) {
+   iwl_scan_cancel_timeout(priv, 100);
+   priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
+   iwl_commit_rxon(priv);
+   }
+
/* Per mac80211.h: This is only used in IBSS mode... */
if (priv-iw_mode != IEEE80211_IF_TYPE_IBSS) {
+
IWL_DEBUG_MAC80211(leave - not in IBSS\n);
mutex_unlock(priv-mutex);
return;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ehea: add kexec support

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a6f4e4983918b18fe5d3fb364afe33db7139870
Commit: 2a6f4e4983918b18fe5d3fb364afe33db7139870
Parent: f920c186be09718542dfa77f6ebe1814be7d35cb
Author: Jan-Bernd Themann [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 14:37:28 2007 +0200
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:47:09 2007 -0400

ehea: add kexec support

eHEA resources that are allocated via H_CALLs have a unique identifier each.
These identifiers are necessary to free the resources. A reboot notifier
is used to free all eHEA resources before the indentifiers get lost, i.e
before kexec starts a new kernel.

Signed-off-by: Jan-Bernd Themann [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/ehea/ehea.h  |2 +-
 drivers/net/ehea/ehea_main.c |   21 +
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 4b4b74e..f78e5bf 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
 #include asm/io.h
 
 #define DRV_NAME   ehea
-#define DRV_VERSIONEHEA_0079
+#define DRV_VERSIONEHEA_0080
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 0a7e789..f0319f1 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -33,6 +33,9 @@
 #include linux/if.h
 #include linux/list.h
 #include linux/if_ether.h
+#include linux/notifier.h
+#include linux/reboot.h
+
 #include net/ip.h
 
 #include ehea.h
@@ -3295,6 +3298,20 @@ static int __devexit ehea_remove(struct of_device *dev)
return 0;
 }
 
+static int ehea_reboot_notifier(struct notifier_block *nb,
+   unsigned long action, void *unused)
+{
+   if (action == SYS_RESTART) {
+   ehea_info(Reboot: freeing all eHEA resources);
+   ibmebus_unregister_driver(ehea_driver);
+   }
+   return NOTIFY_DONE;
+}
+
+static struct notifier_block ehea_reboot_nb = {
+.notifier_call = ehea_reboot_notifier,
+};
+
 static int check_module_parm(void)
 {
int ret = 0;
@@ -3351,6 +3368,8 @@ int __init ehea_module_init(void)
if (ret)
goto out;
 
+   register_reboot_notifier(ehea_reboot_nb);
+
ret = ibmebus_register_driver(ehea_driver);
if (ret) {
ehea_error(failed registering eHEA device driver on ebus);
@@ -3362,6 +3381,7 @@ int __init ehea_module_init(void)
if (ret) {
ehea_error(failed to register capabilities attribute, ret=%d,
   ret);
+   unregister_reboot_notifier(ehea_reboot_nb);
ibmebus_unregister_driver(ehea_driver);
goto out;
}
@@ -3375,6 +3395,7 @@ static void __exit ehea_module_exit(void)
flush_scheduled_work();
driver_remove_file(ehea_driver.driver, driver_attr_capabilities);
ibmebus_unregister_driver(ehea_driver);
+   unregister_reboot_notifier(ehea_reboot_nb);
ehea_destroy_busmap();
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


NOMMU: mm/nommu.c needs linux/module.h

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2b8544f5f50073fcc705e16b45a6821d50eb080
Commit: f2b8544f5f50073fcc705e16b45a6821d50eb080
Parent: cbf67812b2f1431c5e432ddecd202984c6882f2a
Author: David Howells [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 13:15:39 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:53:26 2007 -0700

NOMMU: mm/nommu.c needs linux/module.h

mm/nommu.c needs to #include linux/module.h for it to understand EXPORT_*()
macros.

Signed-off-by: David Howells [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 mm/nommu.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index 8f09333..35622c5 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -12,6 +12,7 @@
  *  Copyright (c) 2002  Greg Ungerer [EMAIL PROTECTED]
  */
 
+#include linux/module.h
 #include linux/mm.h
 #include linux/mman.h
 #include linux/swap.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


blk_sync_queue() should cancel request_queue-unplug_work

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=abbeb88d00bef294ce661a9229c1dc31be064545
Commit: abbeb88d00bef294ce661a9229c1dc31be064545
Parent: 4310864b9d17714e64446bfb8bc7dbcb96454475
Author: Oleg Nesterov [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 15:08:19 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:05 2007 +0100

blk_sync_queue() should cancel request_queue-unplug_work

blk_sync_queue() cancels the timer, but forgets to cancel the work.

Signed-off-by: Oleg Nesterov [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/ll_rw_blk.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 49c0f18..d8616e6 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1738,6 +1738,7 @@ EXPORT_SYMBOL(blk_stop_queue);
 void blk_sync_queue(struct request_queue *q)
 {
del_timer_sync(q-unplug_timer);
+   kblockd_flush_work(q-unplug_work);
 }
 EXPORT_SYMBOL(blk_sync_queue);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


sg_last() should use unsigned loop index variable

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74eb94f7b84f4e631a0e020991fb16f17ce85ab7
Commit: 74eb94f7b84f4e631a0e020991fb16f17ce85ab7
Parent: 30fa0d0f0c0ab2aa0d4c2f88eda49eaa19ea6f8d
Author: Chuck Lever [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 19:29:47 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:04 2007 +0100

sg_last() should use unsigned loop index variable

Clean up: fix a mixed sign comparison in sg_last() accidentally
introduced by commit 70eb8040.  The sign of the loop index variable
should match the sign of the nents argument.

Signed-off-by: Chuck Lever [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 include/linux/scatterlist.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index b2ec842..19b751a 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -150,7 +150,7 @@ static inline struct scatterlist *sg_last(struct 
scatterlist *sgl,
struct scatterlist *ret = sgl[nents - 1];
 #else
struct scatterlist *sg, *ret = NULL;
-   int i;
+   unsigned int i;
 
for_each_sg(sgl, sg, nents, i)
ret = sg;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


clockevents: unexport tick_nohz_get_sleep_length

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=64e38eb082bd845d6758079f65b191203986336d
Commit: 64e38eb082bd845d6758079f65b191203986336d
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Adrian Bunk [EMAIL PROTECTED]
AuthorDate: Wed Oct 24 18:24:22 2007 +0200
Committer:  Thomas Gleixner [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:39:38 2007 +0100

clockevents: unexport tick_nohz_get_sleep_length

This patch removes the unused
EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length).

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 kernel/time/tick-sched.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
index 10a1347..5997456 100644
--- a/kernel/time/tick-sched.c
+++ b/kernel/time/tick-sched.c
@@ -320,8 +320,6 @@ ktime_t tick_nohz_get_sleep_length(void)
return ts-sleep_length;
 }
 
-EXPORT_SYMBOL_GPL(tick_nohz_get_sleep_length);
-
 /**
  * nohz_restart_sched_tick - restart the idle tick from the idle task
  *
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


fix abuses of ptrdiff_t

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=142956af525002c5378e7d91d81a01189841a785
Commit: 142956af525002c5378e7d91d81a01189841a785
Parent: 0c7eb2eb800c4afb2205bbaa1bc633eb29082fef
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:11:28 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:33 2007 -0700

fix abuses of ptrdiff_t

Use of ptrdiff_t in places like

-   if (!access_ok(VERIFY_WRITE, u_tmp-rx_buf, 
u_tmp-len))
+   if (!access_ok(VERIFY_WRITE, (u8 __user *)
+   (ptrdiff_t) u_tmp-rx_buf,
+   u_tmp-len))

is wrong; for one thing, it's a bad C (it's what uintptr_t is for; in 
general
we are not even promised that ptrdiff_t is large enough to hold a pointer,
just enough to hold a difference between two pointers within the same 
object).
For another, it confuses the fsck out of sparse.

Use unsigned long or uintptr_t instead.  There are several places misusing
ptrdiff_t; fixed.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/commctrl.c |   12 ++--
 drivers/scsi/aacraid/comminit.c |2 +-
 drivers/scsi/aacraid/dpcsup.c   |2 +-
 drivers/spi/spidev.c|6 +++---
 include/linux/types.h   |2 ++
 5 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 72b0393..1e6d7a9 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -391,7 +391,7 @@ static int close_getadapter_fib(struct aac_dev * dev, void 
__user *arg)
/*
 *  Extract the fibctx from the input parameters
 */
-   if (fibctx-unique == (u32)(ptrdiff_t)arg) /* We found a winner 
*/
+   if (fibctx-unique == (u32)(uintptr_t)arg) /* We found a winner 
*/
break;
entry = entry-next;
fibctx = NULL;
@@ -590,7 +590,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
}
addr = (u64)upsg-sg[i].addr[0];
addr += ((u64)upsg-sg[i].addr[1])  32;
-   sg_user[i] = (void __user *)(ptrdiff_t)addr;
+   sg_user[i] = (void __user *)(uintptr_t)addr;
sg_list[i] = p; // save so we can clean up later
sg_indx = i;
 
@@ -633,7 +633,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
rcode = -ENOMEM;
goto cleanup;
}
-   sg_user[i] = (void __user 
*)(ptrdiff_t)usg-sg[i].addr;
+   sg_user[i] = (void __user 
*)(uintptr_t)usg-sg[i].addr;
sg_list[i] = p; // save so we can clean up later
sg_indx = i;
 
@@ -664,7 +664,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
if (actual_fibsize64 == fibsize) {
struct user_sgmap64* usg = (struct user_sgmap64 *)upsg;
for (i = 0; i  upsg-count; i++) {
-   u64 addr;
+   uintptr_t addr;
void* p;
/* Does this really need to be GFP_DMA? */
p = 
kmalloc(usg-sg[i].count,GFP_KERNEL|__GFP_DMA);
@@ -676,7 +676,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
}
addr = (u64)usg-sg[i].addr[0];
addr += ((u64)usg-sg[i].addr[1])  32;
-   sg_user[i] = (void __user *)(ptrdiff_t)addr;
+   sg_user[i] = (void __user *)addr;
sg_list[i] = p; // save so we can clean up later
sg_indx = i;
 
@@ -704,7 +704,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
rcode = -ENOMEM;
goto cleanup;
}
-   sg_user[i] = (void __user 
*)(ptrdiff_t)upsg-sg[i].addr;
+   sg_user[i] = (void __user 
*)(uintptr_t)upsg-sg[i].addr;
sg_list[i] = p; // save so we can clean up later
sg_indx = i;
 
diff --git a/drivers/scsi/aacraid/comminit.c 

fix reentrancy bug in arcmsr_get_iop_{r,w}qbuffer()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0c7eb2eb800c4afb2205bbaa1bc633eb29082fef
Commit: 0c7eb2eb800c4afb2205bbaa1bc633eb29082fef
Parent: 6a7d26d58a0f61cffddc8839067dfad10413b852
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:08:58 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:33 2007 -0700

fix reentrancy bug in arcmsr_get_iop_{r,w}qbuffer()

doh...

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/arcmsr/arcmsr_hba.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 4c1b3b4..2f34cdb 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -1068,7 +1068,7 @@ static void arcmsr_iop_message_wrote(struct 
AdapterControlBlock *acb)
 
 struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock 
*acb)
 {
-   static struct QBUFFER __iomem *qbuffer;
+   struct QBUFFER __iomem *qbuffer = NULL;
 
switch (acb-adapter_type) {
 
@@ -1089,7 +1089,7 @@ struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct 
AdapterControlBlock *acb)
 
 static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct 
AdapterControlBlock *acb)
 {
-   static struct QBUFFER __iomem *pqbuffer;
+   struct QBUFFER __iomem *pqbuffer = NULL;
 
switch (acb-adapter_type) {
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86 merge fallout: uml

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca5cd877ae699e758e6f26efc11b01bf6631d427
Commit: ca5cd877ae699e758e6f26efc11b01bf6631d427
Parent: 2a397e82c7db18019e408f953dd58dc1963a328c
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:31:16 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

x86 merge fallout: uml

Don't undef __i386__/__x86_64__ in uml anymore, make sure that (few) places
that required adjusting the ifdefs got those.

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 arch/um/Makefile-i386 |3 +--
 arch/um/Makefile-x86_64   |5 +
 drivers/char/mem.c|4 ++--
 drivers/md/raid6algos.c   |4 ++--
 drivers/md/raid6mmx.c |2 +-
 drivers/md/raid6sse1.c|2 +-
 drivers/md/raid6sse2.c|4 ++--
 drivers/md/raid6x86.h |2 +-
 include/asm-um/unistd.h   |1 -
 include/linux/eventpoll.h |7 +--
 kernel/signal.c   |2 +-
 11 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386
index 0178df3..08433f8 100644
--- a/arch/um/Makefile-i386
+++ b/arch/um/Makefile-i386
@@ -9,6 +9,7 @@ ELF_ARCH:= $(SUBARCH)
 ELF_FORMAT := elf32-$(SUBARCH)
 OBJCOPYFLAGS   := -O binary -R .note -R .comment -S
 HEADER_ARCH:= x86
+CHECKFLAGS += -D__i386__
 
 ifeq ($(origin SUBARCH), command line)
 ifneq ($(shell uname -m | sed -e s/i.86/i386/), $(SUBARCH))
@@ -26,8 +27,6 @@ AFLAGS+= -DCONFIG_X86_32
 CONFIG_X86_32  := y
 export CONFIG_X86_32
 
-ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH)
-
 # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y.
 include $(srctree)/arch/i386/Makefile.cpu
 
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index fe5316f..8ed362f 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -6,12 +6,9 @@ START := 0x6000
 
 _extra_flags_ = -fno-builtin -m64
 
-#We #undef __x86_64__ for kernelspace, not for userspace where
-#it's needed for headers to work!
-ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__
 KBUILD_CFLAGS += $(_extra_flags_)
 
-CHECKFLAGS  += -m64
+CHECKFLAGS  += -m64 -D__x86_64__
 KBUILD_AFLAGS += -m64
 LDFLAGS += -m elf_x86_64
 KBUILD_CPPFLAGS += -m64
diff --git a/drivers/char/mem.c b/drivers/char/mem.c
index 0e937f6..20070b7 100644
--- a/drivers/char/mem.c
+++ b/drivers/char/mem.c
@@ -41,7 +41,7 @@
  */
 static inline int uncached_access(struct file *file, unsigned long addr)
 {
-#if defined(__i386__)
+#if defined(__i386__)  !defined(__arch_um__)
/*
 * On the PPro and successors, the MTRRs are used to set
 * memory types for physical addresses outside main memory,
@@ -57,7 +57,7 @@ static inline int uncached_access(struct file *file, unsigned 
long addr)
  test_bit(X86_FEATURE_CYRIX_ARR, boot_cpu_data.x86_capability) 
||
  test_bit(X86_FEATURE_CENTAUR_MCR, 
boot_cpu_data.x86_capability) )
   addr = __pa(high_memory);
-#elif defined(__x86_64__)
+#elif defined(__x86_64__)  !defined(__arch_um__)
/* 
 * This is broken because it can generate memory type aliases,
 * which can cause cache corruptions
diff --git a/drivers/md/raid6algos.c b/drivers/md/raid6algos.c
index 9265761..77a6e4b 100644
--- a/drivers/md/raid6algos.c
+++ b/drivers/md/raid6algos.c
@@ -52,7 +52,7 @@ const struct raid6_calls * const raid6_algos[] = {
raid6_intx16,
raid6_intx32,
 #endif
-#if defined(__i386__)
+#if defined(__i386__)  !defined(__arch_um__)
raid6_mmxx1,
raid6_mmxx2,
raid6_sse1x1,
@@ -60,7 +60,7 @@ const struct raid6_calls * const raid6_algos[] = {
raid6_sse2x1,
raid6_sse2x2,
 #endif
-#if defined(__x86_64__)
+#if defined(__x86_64__)  !defined(__arch_um__)
raid6_sse2x1,
raid6_sse2x2,
raid6_sse2x4,
diff --git a/drivers/md/raid6mmx.c b/drivers/md/raid6mmx.c
index 6181a5a..d4e4a1b 100644
--- a/drivers/md/raid6mmx.c
+++ b/drivers/md/raid6mmx.c
@@ -16,7 +16,7 @@
  * MMX implementation of RAID-6 syndrome functions
  */
 
-#if defined(__i386__)
+#if defined(__i386__)  !defined(__arch_um__)
 
 #include raid6.h
 #include raid6x86.h
diff --git a/drivers/md/raid6sse1.c b/drivers/md/raid6sse1.c
index f0a1ba8..0666237 100644
--- a/drivers/md/raid6sse1.c
+++ b/drivers/md/raid6sse1.c
@@ -21,7 +21,7 @@
  * worthwhile as a separate implementation.
  */
 
-#if defined(__i386__)
+#if defined(__i386__)  !defined(__arch_um__)
 
 #include raid6.h
 #include raid6x86.h
diff --git a/drivers/md/raid6sse2.c b/drivers/md/raid6sse2.c
index 0f01976..b034ad8 100644
--- a/drivers/md/raid6sse2.c
+++ b/drivers/md/raid6sse2.c
@@ -17,7 +17,7 @@
  *
  */
 
-#if defined(__i386__) || defined(__x86_64__)
+#if (defined(__i386__) || 

intel-iommu fixes

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4fe05bbcd53160616774b6f5619b8a55bcfa1c57
Commit: 4fe05bbcd53160616774b6f5619b8a55bcfa1c57
Parent: b4a08a10b12c145da67cc788849bf7cc6efaa210
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 04:51:16 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:32 2007 -0700

intel-iommu fixes

 - off by one in dmar_get_fault_reason() (maximal index in array is
   ARRAY_SIZE()-1, not ARRAY_SIZE())
 - NULL noise removal
 - __iomem annotation fix

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/pci/intel-iommu.c |7 +++
 drivers/pci/intel-iommu.h |2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 0c4ab3b..9b35259 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -745,7 +745,7 @@ static char *fault_reason_strings[] =
non-zero reserved fields in PTE,
Unknown
 };
-#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings)
+#define MAX_FAULT_REASON_IDX   ARRAY_SIZE(fault_reason_strings) - 1
 
 char *dmar_get_fault_reason(u8 fault_reason)
 {
@@ -995,7 +995,6 @@ static struct intel_iommu *alloc_iommu(struct 
dmar_drhd_unit *drhd)
return iommu;
 error_unmap:
iounmap(iommu-reg);
-   iommu-reg = 0;
 error:
kfree(iommu);
return NULL;
@@ -1808,7 +1807,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
if (!domain) {
printk(KERN_ERR
Allocating domain for %s failed, pci_name(pdev));
-   return 0;
+   return NULL;
}
 
/* make sure context mapping is ok */
@@ -1818,7 +1817,7 @@ get_valid_domain_for_dev(struct pci_dev *pdev)
printk(KERN_ERR
Domain context map for %s failed,
pci_name(pdev));
-   return 0;
+   return NULL;
}
}
 
diff --git a/drivers/pci/intel-iommu.h b/drivers/pci/intel-iommu.h
index ee88dd2..459ad1f 100644
--- a/drivers/pci/intel-iommu.h
+++ b/drivers/pci/intel-iommu.h
@@ -58,7 +58,7 @@
hi = readl(dmar + reg + 4); \
(((u64) hi)  32) + lo; })
 */
-static inline u64 dmar_readq(void *addr)
+static inline u64 dmar_readq(void __iomem *addr)
 {
u32 lo, hi;
lo = readl(addr);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


trivial annotations in arcmsr

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=80da1adbbf8805bc1a5d287ab171463710b7d92e
Commit: 80da1adbbf8805bc1a5d287ab171463710b7d92e
Parent: d06f608265d5fc41aefe2fae5b62da4893ecae35
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:08:28 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:33 2007 -0700

trivial annotations in arcmsr

driver still has serious portability problems

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/arcmsr/arcmsr.h  |   32 ---
 drivers/scsi/arcmsr/arcmsr_attr.c |6 +-
 drivers/scsi/arcmsr/arcmsr_hba.c  |  170 ++---
 3 files changed, 103 insertions(+), 105 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
index ace7a15..3c38cd8 100644
--- a/drivers/scsi/arcmsr/arcmsr.h
+++ b/drivers/scsi/arcmsr/arcmsr.h
@@ -141,14 +141,14 @@ struct CMD_MESSAGE_FIELD
 #define IS_SG64_ADDR0x0100 /* bit24 */
 struct  SG32ENTRY
 {
-   uint32_tlength;
-   uint32_taddress;
+   __le32  length;
+   __le32  address;
 };
 struct  SG64ENTRY
 {
-   uint32_tlength;
-   uint32_taddress;
-   uint32_taddresshigh;
+   __le32  length;
+   __le32  address;
+   __le32  addresshigh;
 };
 struct SGENTRY_UNION
 {
@@ -339,13 +339,13 @@ struct MessageUnit_B
uint32_tdone_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];
uint32_tpostq_index;
uint32_tdoneq_index;
-   uint32_t*drv2iop_doorbell_reg;
-   uint32_t*drv2iop_doorbell_mask_reg;
-   uint32_t*iop2drv_doorbell_reg;
-   uint32_t*iop2drv_doorbell_mask_reg;
-   uint32_t*msgcode_rwbuffer_reg;
-   uint32_t*ioctl_wbuffer_reg;
-   uint32_t*ioctl_rbuffer_reg;
+   uint32_t__iomem *drv2iop_doorbell_reg;
+   uint32_t__iomem *drv2iop_doorbell_mask_reg;
+   uint32_t__iomem *iop2drv_doorbell_reg;
+   uint32_t__iomem *iop2drv_doorbell_mask_reg;
+   uint32_t__iomem *msgcode_rwbuffer_reg;
+   uint32_t__iomem *ioctl_wbuffer_reg;
+   uint32_t__iomem *ioctl_rbuffer_reg;
 };
 
 struct MessageUnit
@@ -374,7 +374,11 @@ struct AdapterControlBlock
/* Offset is used in making arc cdb physical to virtual calculations */
uint32_toutbound_int_enable;
 
-   struct MessageUnit *pmu;
+   union {
+   struct MessageUnit *pmu;
+   struct MessageUnit_A __iomem *  pmuA;
+   struct MessageUnit_B *  pmuB;
+   };
/* message unit ATU inbound base address0 */
 
uint32_tacb_flags;
@@ -558,7 +562,7 @@ struct SENSE_DATA
 
 extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *);
 extern void arcmsr_iop_message_read(struct AdapterControlBlock *);
-extern struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *);
+extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct 
AdapterControlBlock *);
 extern struct class_device_attribute *arcmsr_host_attrs[];
 extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *);
 void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb);
diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c 
b/drivers/scsi/arcmsr/arcmsr_attr.c
index d04d1aa..7d7b0a5 100644
--- a/drivers/scsi/arcmsr/arcmsr_attr.c
+++ b/drivers/scsi/arcmsr/arcmsr_attr.c
@@ -85,13 +85,13 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct kobject 
*kobj,
allxfer_len++;
}
if (acb-acb_flags  ACB_F_IOPDATA_OVERFLOW) {
-   struct QBUFFER *prbuffer;
-   uint8_t *iop_data;
+   struct QBUFFER __iomem *prbuffer;
+   uint8_t __iomem *iop_data;
int32_t iop_len;
 
acb-acb_flags = ~ACB_F_IOPDATA_OVERFLOW;
prbuffer = arcmsr_get_iop_rqbuffer(acb);
-   iop_data = (uint8_t *)prbuffer-data;
+   iop_data = prbuffer-data;
iop_len = readl(prbuffer-data_len);
while (iop_len  0) {
acb-rqbuffer[acb-rqbuf_lastindex] = readb(iop_data);
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index f7a2528..aaee028 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -236,8 +236,8 @@ static int 

timer_list: Fix printk format strings

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=129f1d2c5352eea3f7c8af9f8c1006dc0da7be52
Commit: 129f1d2c5352eea3f7c8af9f8c1006dc0da7be52
Parent: 64e38eb082bd845d6758079f65b191203986336d
Author: Vegard Nossum [EMAIL PROTECTED]
AuthorDate: Thu Oct 11 08:23:34 2007 +0200
Committer:  Thomas Gleixner [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:39:38 2007 +0100

timer_list: Fix printk format strings

This makes sure printk format strings contain no more than a single
line.

Signed-off-by: Vegard Nossum [EMAIL PROTECTED]
Signed-off-by: Thomas Gleixner [EMAIL PROTECTED]
---
 kernel/time/timer_list.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index fdb2e03..12c5f4c 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -129,7 +129,8 @@ static void print_cpu(struct seq_file *m, int cpu, u64 now)
struct hrtimer_cpu_base *cpu_base = per_cpu(hrtimer_bases, cpu);
int i;
 
-   SEQ_printf(m, \ncpu: %d\n, cpu);
+   SEQ_printf(m, \n);
+   SEQ_printf(m, cpu: %d\n, cpu);
for (i = 0; i  HRTIMER_MAX_CLOCK_BASES; i++) {
SEQ_printf(m,  clock %d:\n, i);
print_base(m, cpu_base-clock_base + i, now);
@@ -184,7 +185,8 @@ print_tickdevice(struct seq_file *m, struct tick_device *td)
 {
struct clock_event_device *dev = td-evtdev;
 
-   SEQ_printf(m, \nTick Device: mode: %d\n, td-mode);
+   SEQ_printf(m, \n);
+   SEQ_printf(m, Tick Device: mode: %d\n, td-mode);
 
SEQ_printf(m, Clock Event Device: );
if (!dev) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


deal with resource allocation bugs in arcmsr

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db3a91fe2b425c9adde47069efebdba44e665cef
Commit: db3a91fe2b425c9adde47069efebdba44e665cef
Parent: 142956af525002c5378e7d91d81a01189841a785
Author: Al Viro [EMAIL PROTECTED]
AuthorDate: Mon Oct 29 05:08:38 2007 +
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Mon Oct 29 07:41:33 2007 -0700

deal with resource allocation bugs in arcmsr

a) for type B we should _not_ iounmap() acb-pmu; it's not ioremapped.
b) for type B we should iounmap() two regions we _do_ ioremap.
c) if ioremap() fails, we need to bail out (and clean up).

Signed-off-by: Al Viro [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/arcmsr/arcmsr.h |9 -
 drivers/scsi/arcmsr/arcmsr_hba.c |   33 ++---
 2 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
index 3c38cd8..a67e29f 100644
--- a/drivers/scsi/arcmsr/arcmsr.h
+++ b/drivers/scsi/arcmsr/arcmsr.h
@@ -348,14 +348,6 @@ struct MessageUnit_B
uint32_t__iomem *ioctl_rbuffer_reg;
 };
 
-struct MessageUnit
-{
-   union
-   {
-   struct MessageUnit_Apmu_A;
-   struct MessageUnit_Bpmu_B;
-   } u;
-};
 /*
 ***
 ** Adapter Control Block
@@ -375,7 +367,6 @@ struct AdapterControlBlock
uint32_toutbound_int_enable;
 
union {
-   struct MessageUnit *pmu;
struct MessageUnit_A __iomem *  pmuA;
struct MessageUnit_B *  pmuB;
};
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index 2f34cdb..d466a2d 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -240,14 +240,18 @@ static int arcmsr_alloc_ccb_pool(struct 
AdapterControlBlock *acb)
if (!acb-pmuA) {
printk(KERN_NOTICE arcmsr%d: memory mapping region 
fail \n,
acb-host-host_no);
+   return -ENOMEM;
}
 
dma_coherent = dma_alloc_coherent(pdev-dev,
ARCMSR_MAX_FREECCB_NUM *
sizeof (struct CommandControlBlock) + 0x20,
dma_coherent_handle, GFP_KERNEL);
-   if (!dma_coherent)
+
+   if (!dma_coherent) {
+   iounmap(acb-pmuA);
return -ENOMEM;
+   }
 
acb-dma_coherent = dma_coherent;
acb-dma_coherent_handle = dma_coherent_handle;
@@ -331,8 +335,16 @@ static int arcmsr_alloc_ccb_pool(struct 
AdapterControlBlock *acb)
acb-pmuB = reg;
mem_base0 = ioremap(pci_resource_start(pdev, 0),
pci_resource_len(pdev, 0));
+   if (!mem_base0)
+   goto out;
+
mem_base1 = ioremap(pci_resource_start(pdev, 2),
pci_resource_len(pdev, 2));
+   if (!mem_base1) {
+   iounmap(mem_base0);
+   goto out;
+   }
+
reg-drv2iop_doorbell_reg = mem_base0 + ARCMSR_DRV2IOP_DOORBELL;
reg-drv2iop_doorbell_mask_reg = mem_base0 +
ARCMSR_DRV2IOP_DOORBELL_MASK;
@@ -357,6 +369,12 @@ static int arcmsr_alloc_ccb_pool(struct 
AdapterControlBlock *acb)
break;
}
return 0;
+
+out:
+   dma_free_coherent(acb-pdev-dev,
+   ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock) + 
0x20,
+   acb-dma_coherent, acb-dma_coherent_handle);
+   return -ENOMEM;
 }
 
 static int arcmsr_probe(struct pci_dev *pdev,
@@ -449,7 +467,6 @@ static int arcmsr_probe(struct pci_dev *pdev,
free_irq(pdev-irq, acb);
  out_free_ccb_pool:
arcmsr_free_ccb_pool(acb);
-   iounmap(acb-pmu);
  out_release_regions:
pci_release_regions(pdev);
  out_host_put:
@@ -810,7 +827,6 @@ static void arcmsr_remove(struct pci_dev *pdev)
}
 
free_irq(pdev-irq, acb);
-   iounmap(acb-pmu);
arcmsr_free_ccb_pool(acb);
pci_release_regions(pdev);
 
@@ -1018,6 +1034,17 @@ static void arcmsr_stop_adapter_bgrb(struct 
AdapterControlBlock *acb)
 
 static void arcmsr_free_ccb_pool(struct AdapterControlBlock *acb)
 {
+   switch (acb-adapter_type) {
+   case ACB_ADAPTER_TYPE_A: {
+   iounmap(acb-pmuA);
+   break;
+   }
+   case ACB_ADAPTER_TYPE_B: {
+   struct MessageUnit_B *reg = acb-pmuB;
+   iounmap(reg-drv2iop_doorbell_reg - 

SG: s390-scsi: missing size parameter in zfcp_address_to_sg()

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9335432959111c982c74177521305e6a3fb600a3
Commit: 9335432959111c982c74177521305e6a3fb600a3
Parent: 73fd546aa75e9db02526bf304d4f736c4ec82b4b
Author: Jens Axboe [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:55:40 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:03 2007 +0100

SG: s390-scsi: missing size parameter in zfcp_address_to_sg()

Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/s390/scsi/zfcp_def.h |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_def.h b/drivers/s390/scsi/zfcp_def.h
index 0754542..e268f79 100644
--- a/drivers/s390/scsi/zfcp_def.h
+++ b/drivers/s390/scsi/zfcp_def.h
@@ -70,11 +70,12 @@ zfcp_sg_to_address(struct scatterlist *list)
  * zfcp_address_to_sg - set up struct scatterlist from kernel address
  * @address: kernel address
  * @list: struct scatterlist
+ * @size: buffer size
  */
 static inline void
-zfcp_address_to_sg(void *address, struct scatterlist *list)
+zfcp_address_to_sg(void *address, struct scatterlist *list, unsigned int size)
 {
-   sg_set_buf(list, address, 0);
+   sg_set_buf(list, address, size);
 }
 
 #define REQUEST_LIST_SIZE 128
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


x86: fix pci-gart failure handling

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5336940dd8b11180a0340ba886db62f728377d19
Commit: 5336940dd8b11180a0340ba886db62f728377d19
Parent: 9335432959111c982c74177521305e6a3fb600a3
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 13:56:24 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:03 2007 +0100

x86: fix pci-gart failure handling

blk_rq_map_sg doesn't initialize sg-dma_address/length to zero
anymore. Some low level drivers reuse sg lists without initializing so
IOMMUs might get non-zero dma_address/length. If map_sg fails, we need
pass the number of the mapped entries to gart_unmap_sg.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 arch/x86/kernel/pci-gart_64.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index ae7e016..79b514b 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -435,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct 
scatterlist *sg, int nents,
 
 error:
flush_gart();
-   gart_unmap_sg(dev, sg, nents, dir);
+   gart_unmap_sg(dev, sg, out, dir);
/* When it was forced or merged try again in a dumb way */
if (force_iommu || iommu_merge) {
out = dma_map_sg_nonforce(dev, sg, nents, dir);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Initialise scatter/gather list in sg driver

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=30fa0d0f0c0ab2aa0d4c2f88eda49eaa19ea6f8d
Commit: 30fa0d0f0c0ab2aa0d4c2f88eda49eaa19ea6f8d
Parent: acd054a5ef401e03e0047b487e572442614f81e5
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 14:00:14 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:03 2007 +0100

Initialise scatter/gather list in sg driver

After turning on DEBUG_SG I hit a fail:

kernel BUG at include/linux/scatterlist.h:50!

sg_build_indirect
sg_build_reserve
sg_open
chrdev_open
__dentry_open
do_filp_open
do_sys_open

We should initialise the sg list when we allocate it in sg_build_sgat.

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/scsi/sg.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index b5fa4f0..f1871ea 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1652,6 +1652,7 @@ sg_build_sgat(Sg_scatter_hold * schp, const Sg_fd * sfp, 
int tablesize)
schp-buffer = kzalloc(sg_bufflen, gfp_flags);
if (!schp-buffer)
return -ENOMEM;
+   sg_init_table(schp-buffer, tablesize);
schp-sglist_len = sg_bufflen;
return tablesize;   /* number of scat_gath elements allocated */
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Correction of Update drivers to use sg helpers patch for IMXMMC driver

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1efa2a3ea266e093f690c20af7522d95540f74f
Commit: e1efa2a3ea266e093f690c20af7522d95540f74f
Parent: 513f54b78f9594927ede66b6c66a70c1bae0c4ca
Author: Pavel Pisa [EMAIL PROTECTED]
AuthorDate: Fri Oct 26 19:29:49 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 09:18:04 2007 +0100

Correction of Update drivers to use sg helpers patch for IMXMMC driver

The previous change omits data- prefix
in the data-sg case. This change fixes kernel
compilation.

Signed-off-by: Pavel Pisa [EMAIL PROTECTED]

 drivers/mmc/host/imxmmc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/mmc/host/imxmmc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/imxmmc.c b/drivers/mmc/host/imxmmc.c
index fc72e1f..f2070a1 100644
--- a/drivers/mmc/host/imxmmc.c
+++ b/drivers/mmc/host/imxmmc.c
@@ -262,7 +262,7 @@ static void imxmci_setup_data(struct imxmci_host *host, 
struct mmc_data *data)
}
 
/* Convert back to virtual address */
-   host-data_ptr = (u16*)sg_virt(sg);
+   host-data_ptr = (u16*)sg_virt(data-sg);
host-data_cnt = 0;
 
clear_bit(IMXMCI_PEND_DMA_DATA_b, host-pending_events);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cfq_get_queue: fix possible NULL pointer access

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0a0836a09ca7a27341703ef154c82e2e7f3e96f4
Commit: 0a0836a09ca7a27341703ef154c82e2e7f3e96f4
Parent: abbeb88d00bef294ce661a9229c1dc31be064545
Author: Oleg Nesterov [EMAIL PROTECTED]
AuthorDate: Tue Oct 23 15:08:21 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:05 2007 +0100

cfq_get_queue: fix possible NULL pointer access

cfq_get_queue()-cfq_find_alloc_queue() can fail, check the returned value.

Signed-off-by: Oleg Nesterov [EMAIL PROTECTED]

Note that this isn't a bug at the moment, since the regular IO path
does not call this path without __GFP_WAIT set. However, it could be a
future bug, so I've applied it.

Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/cfq-iosched.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index d77c971..e47a930 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -1443,8 +1443,11 @@ cfq_get_queue(struct cfq_data *cfqd, int is_sync, struct 
task_struct *tsk,
cfqq = *async_cfqq;
}
 
-   if (!cfqq)
+   if (!cfqq) {
cfqq = cfq_find_alloc_queue(cfqd, is_sync, tsk, gfp_mask);
+   if (!cfqq)
+   return NULL;
+   }
 
/*
 * pin the queue now that it's allocated, scheduler exit will prune it
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


compat_ioctl: fix block device compat ioctl regression

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33013a881104304fcffe817f17f22a1588908037
Commit: 33013a881104304fcffe817f17f22a1588908037
Parent: 6eca9004dfcb274a502438a591df5b197690afb1
Author: Philip Langdale [EMAIL PROTECTED]
AuthorDate: Sat Oct 27 13:34:10 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:06 2007 +0100

compat_ioctl: fix block device compat ioctl regression

The conversion of handlers to compat_blkdev_ioctl accidentally
disabled handling of most ioctl numbers on block devices because
of a typo. Fix the one line to enable it all again.

Signed-off-by: Arnd Bergmann [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/compat_ioctl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/block/compat_ioctl.c b/block/compat_ioctl.c
index f84093b..cae0a85 100644
--- a/block/compat_ioctl.c
+++ b/block/compat_ioctl.c
@@ -581,7 +581,7 @@ static int compat_blkdev_driver_ioctl(struct inode *inode, 
struct file *file,
 {
int ret;
 
-   switch (arg) {
+   switch (cmd) {
case HDIO_GET_UNMASKINTR:
case HDIO_GET_MULTCOUNT:
case HDIO_GET_KEEPSETTINGS:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cciss: update copyright notices

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bd4f36d6da175ed51840fe07b8906951c4dea609
Commit: bd4f36d6da175ed51840fe07b8906951c4dea609
Parent: 0a0836a09ca7a27341703ef154c82e2e7f3e96f4
Author: Mike Miller [EMAIL PROTECTED]
AuthorDate: Wed Oct 24 10:30:34 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:05 2007 +0100

cciss: update copyright notices

This patch updates the copyright information for the cciss driver. It
includes extending the year to 2007 (how timely) and some minor corrections
deemed necessary by HP legal and the Open Source Review Board. Please
consider this patch for inclusion.

Signed-off-by: Mike Miller [EMAIL PROTECTED]


Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 drivers/block/cciss.c  |   14 +++---
 drivers/block/cciss_scsi.c |   14 +++---
 drivers/block/cciss_scsi.h |   14 +++---
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 5a6fe17..7d70496 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1,20 +1,20 @@
 /*
- *Disk Array driver for HP SA 5xxx and 6xxx Controllers
- *Copyright 2000, 2006 Hewlett-Packard Development Company, L.P.
+ *Disk Array driver for HP Smart Array controllers.
+ *(C) Copyright 2000, 2007 Hewlett-Packard Development Company, L.P.
  *
  *This program is free software; you can redistribute it and/or modify
  *it under the terms of the GNU General Public License as published by
- *the Free Software Foundation; either version 2 of the License, or
- *(at your option) any later version.
+ *the Free Software Foundation; version 2 of the License.
  *
  *This program is distributed in the hope that it will be useful,
  *but WITHOUT ANY WARRANTY; without even the implied warranty of
- *MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *General Public License for more details.
  *
  *You should have received a copy of the GNU General Public License
  *along with this program; if not, write to the Free Software
- *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ *02111-1307, USA.
  *
  *Questions/Comments/Bugfixes to [EMAIL PROTECTED]
  *
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
index 4aca7dd..63ee6c0 100644
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_scsi.c
@@ -1,20 +1,20 @@
 /*
- *Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *Copyright 2001 Compaq Computer Corporation
+ *Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *(C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *This program is free software; you can redistribute it and/or modify
  *it under the terms of the GNU General Public License as published by
- *the Free Software Foundation; either version 2 of the License, or
- *(at your option) any later version.
+ *the Free Software Foundation; version 2 of the License.
  *
  *This program is distributed in the hope that it will be useful,
  *but WITHOUT ANY WARRANTY; without even the implied warranty of
- *MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
- *NON INFRINGEMENT.  See the GNU General Public License for more details.
+ *MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ *General Public License for more details.
  *
  *You should have received a copy of the GNU General Public License
  *along with this program; if not, write to the Free Software
- *Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *Foundation, Inc., 59 Temple Place, Suite 300, Boston, MA
+ *02111-1307, USA.
  *
  *Questions/Comments/Bugfixes to [EMAIL PROTECTED]
  *
diff --git a/drivers/block/cciss_scsi.h b/drivers/block/cciss_scsi.h
index 5e7e06c..d9c2c58 100644
--- a/drivers/block/cciss_scsi.h
+++ b/drivers/block/cciss_scsi.h
@@ -1,20 +1,20 @@
 /*
- *Disk Array driver for Compaq SA53xx Controllers, SCSI Tape module
- *Copyright 2001 Compaq Computer Corporation
+ *Disk Array driver for HP Smart Array controllers, SCSI Tape module.
+ *(C) Copyright 2001, 2007 Hewlett-Packard Development Company, L.P.
  *
  *This program is free software; you can redistribute it and/or modify
  *it under the terms of the GNU General Public License as published by
- *the Free Software Foundation; either version 2 of the License, or
- *(at your option) any later version.
+ *the Free Software 

Fix a build error when BLOCK=n

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a424f2d56613acfb9e583ec9c85a2be3e3af028
Commit: 3a424f2d56613acfb9e583ec9c85a2be3e3af028
Parent: adb4ddbbfb90c302e78da68b3f015588ca45d7f3
Author: Emil Medve [EMAIL PROTECTED]
AuthorDate: Wed Oct 24 14:18:32 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:06 2007 +0100

Fix a build error when BLOCK=n

mm/filemap.c: In function '__filemap_fdatawrite_range':
mm/filemap.c:200: error: implicit declaration of function
'mapping_cap_writeback_dirty'

This happens when we don't use/have any block devices and a NFS root
filesystem is used.

mapping_cap_writeback_dirty() is defined in linux/backing-dev.h which
used to be provided in mm/filemap.c by linux/blkdev.h until commit
f5ff8422bbdd59f8c1f699df248e1b7a11073027 (Fix warnings with
!CONFIG_BLOCK).

Signed-off-by: Emil Medve [EMAIL PROTECTED]
Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 mm/filemap.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/mm/filemap.c b/mm/filemap.c
index 5209e47..7c86436 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -28,6 +28,7 @@
 #include linux/backing-dev.h
 #include linux/pagevec.h
 #include linux/blkdev.h
+#include linux/backing-dev.h
 #include linux/security.h
 #include linux/syscalls.h
 #include linux/cpuset.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[BLOCK] Fix bad sharing of tag busy list on queues with shared tag maps

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6eca9004dfcb274a502438a591df5b197690afb1
Commit: 6eca9004dfcb274a502438a591df5b197690afb1
Parent: 3a424f2d56613acfb9e583ec9c85a2be3e3af028
Author: Jens Axboe [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 10:14:47 2007 +0200
Committer:  Jens Axboe [EMAIL PROTECTED]
CommitDate: Mon Oct 29 11:33:06 2007 +0100

[BLOCK] Fix bad sharing of tag busy list on queues with shared tag maps

For the locking to work, only the tag map and tag bit map may be shared
(incidentally, I was just explaining this to Nick yesterday, but I
apparently didn't review the code well enough myself). But we also share
the busy list!  The busy_list must be queue private, or we need a
block_queue_tag covering lock as well.

So we have to move the busy_list to the queue. This'll work fine, and
it'll actually also fix a problem with blk_queue_invalidate_tags() which
will invalidate tags across all shared queues. This is a bit confusing,
the low level driver should call it for each queue seperately since
otherwise you cannot kill tags on just a single queue for eg a hard
drive that stops responding. Since the function has no callers
currently, it's not an issue.

Signed-off-by: Jens Axboe [EMAIL PROTECTED]
---
 block/ll_rw_blk.c  |8 +++-
 include/linux/blkdev.h |2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index a8a1810..56f2646 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -791,7 +791,6 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)
retval = atomic_dec_and_test(bqt-refcnt);
if (retval) {
BUG_ON(bqt-busy);
-   BUG_ON(!list_empty(bqt-busy_list));
 
kfree(bqt-tag_index);
bqt-tag_index = NULL;
@@ -903,7 +902,6 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct 
request_queue *q,
if (init_tag_map(q, tags, depth))
goto fail;
 
-   INIT_LIST_HEAD(tags-busy_list);
tags-busy = 0;
atomic_set(tags-refcnt, 1);
return tags;
@@ -954,6 +952,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
 */
q-queue_tags = tags;
q-queue_flags |= (1  QUEUE_FLAG_QUEUED);
+   INIT_LIST_HEAD(q-tag_busy_list);
return 0;
 fail:
kfree(tags);
@@ -1122,7 +1121,7 @@ int blk_queue_start_tag(struct request_queue *q, struct 
request *rq)
rq-tag = tag;
bqt-tag_index[tag] = rq;
blkdev_dequeue_request(rq);
-   list_add(rq-queuelist, bqt-busy_list);
+   list_add(rq-queuelist, q-tag_busy_list);
bqt-busy++;
return 0;
 }
@@ -1143,11 +1142,10 @@ EXPORT_SYMBOL(blk_queue_start_tag);
  **/
 void blk_queue_invalidate_tags(struct request_queue *q)
 {
-   struct blk_queue_tag *bqt = q-queue_tags;
struct list_head *tmp, *n;
struct request *rq;
 
-   list_for_each_safe(tmp, n, bqt-busy_list) {
+   list_for_each_safe(tmp, n, q-tag_busy_list) {
rq = list_entry_rq(tmp);
 
if (rq-tag == -1) {
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bbf906a..8396db2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -341,7 +341,6 @@ enum blk_queue_state {
 struct blk_queue_tag {
struct request **tag_index; /* map of busy tags */
unsigned long *tag_map; /* bit map of free/busy tags */
-   struct list_head busy_list; /* fifo list of busy tags */
int busy;   /* current depth */
int max_depth;  /* what we will send to device */
int real_max_depth; /* what the array can hold */
@@ -435,6 +434,7 @@ struct request_queue
unsigned intdma_alignment;
 
struct blk_queue_tag*queue_tags;
+   struct list_headtag_busy_list;
 
unsigned intnr_sorted;
unsigned intin_flight;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


e1000e: Fix jumbo frame receive code.

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=47f44e40a3c12f8604aba9288d7a7f991cbf17ba
Commit: 47f44e40a3c12f8604aba9288d7a7f991cbf17ba
Parent: e38c2c651a038b78fd01cf2e3f3a65cacf0e41cc
Author: Auke Kok [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 13:57:44 2007 -0700
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:47:08 2007 -0400

e1000e: Fix jumbo frame receive code.

Fix allocation and freeing of jumbo frames where several bugs
were recently introduced by cleanups after we forked this code
from e1000. This moves ps_pages to buffer_info where it really
belongs and makes it a dynamically allocated array. The penalty
is not that high since it's allocated outside of the buffer_info
struct anyway.

Without this patch all jumbo frames are completely broken and the
driver panics.

Signed-off-by: Jesse Brandeburg [EMAIL PROTECTED]
Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/e1000e/e1000.h  |4 +-
 drivers/net/e1000e/netdev.c |  102 ++-
 2 files changed, 54 insertions(+), 52 deletions(-)

diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h
index d2499bb..811eada 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -123,6 +123,8 @@ struct e1000_buffer {
};
/* RX */
struct page *page;
+   /* arrays of page information for packet split */
+   struct e1000_ps_page *ps_pages;
};
 
 };
@@ -142,8 +144,6 @@ struct e1000_ring {
/* array of buffer information structs */
struct e1000_buffer *buffer_info;
 
-   /* arrays of page information for packet split */
-   struct e1000_ps_page *ps_pages;
struct sk_buff *rx_skb_top;
 
struct e1000_queue_stats stats;
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 033e124..46c5ac6 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -245,37 +245,36 @@ static void e1000_alloc_rx_buffers_ps(struct 
e1000_adapter *adapter,
rx_desc = E1000_RX_DESC_PS(*rx_ring, i);
 
for (j = 0; j  PS_PAGE_BUFFERS; j++) {
-   ps_page = rx_ring-ps_pages[(i * PS_PAGE_BUFFERS)
-+ j];
-   if (j  adapter-rx_ps_pages) {
+   ps_page = buffer_info-ps_pages[j];
+   if (j = adapter-rx_ps_pages) {
+   /* all unused desc entries get hw null ptr */
+   rx_desc-read.buffer_addr[j+1] = ~0;
+   continue;
+   }
+   if (!ps_page-page) {
+   ps_page-page = alloc_page(GFP_ATOMIC);
if (!ps_page-page) {
-   ps_page-page = alloc_page(GFP_ATOMIC);
-   if (!ps_page-page) {
-   adapter-alloc_rx_buff_failed++;
-   goto no_buffers;
-   }
-   ps_page-dma = pci_map_page(pdev,
-  ps_page-page,
-  0, PAGE_SIZE,
-  PCI_DMA_FROMDEVICE);
-   if (pci_dma_mapping_error(
-   ps_page-dma)) {
-   dev_err(adapter-pdev-dev,
- RX DMA page map failed\n);
-   adapter-rx_dma_failed++;
-   goto no_buffers;
-   }
+   adapter-alloc_rx_buff_failed++;
+   goto no_buffers;
+   }
+   ps_page-dma = pci_map_page(pdev,
+  ps_page-page,
+  0, PAGE_SIZE,
+  PCI_DMA_FROMDEVICE);
+   if (pci_dma_mapping_error(ps_page-dma)) {
+   dev_err(adapter-pdev-dev,
+ RX DMA page map failed\n);
+   adapter-rx_dma_failed++;
+   goto no_buffers;
}
-   /*
-* Refresh the desc 

e1000e: Fix PBA calculation for jumbo frame packets

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df762464ad0fad721f9fc5724e85b3df0d550acd
Commit: df762464ad0fad721f9fc5724e85b3df0d550acd
Parent: 47f44e40a3c12f8604aba9288d7a7f991cbf17ba
Author: Auke Kok [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 13:57:53 2007 -0700
Committer:  Jeff Garzik [EMAIL PROTECTED]
CommitDate: Mon Oct 29 05:47:08 2007 -0400

e1000e: Fix PBA calculation for jumbo frame packets

Upon inspection the rx FIFO size calculation code was found to have
2 significant flaws: A superfluous minus sign resulting in the
wrong size to be used for jumbo frames on 82573 and ich9, as well
as that this code rewrote the read-only adapter-pba variable
resulting in different values at each run.

Without this patch jumbo's will work but performance will be
awkward since the TX size is not adequate for two whole frames.

Signed-off-by: Auke Kok [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]
---
 drivers/net/e1000e/netdev.c |   22 +-
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 46c5ac6..e87ed31 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2328,8 +2328,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
struct e1000_mac_info *mac = adapter-hw.mac;
struct e1000_hw *hw = adapter-hw;
u32 tx_space, min_tx_space, min_rx_space;
+   u32 pba;
u16 hwm;
 
+   ew32(PBA, adapter-pba);
+
if (mac-max_frame_size  ETH_FRAME_LEN + ETH_FCS_LEN ) {
/* To maintain wire speed transmits, the Tx FIFO should be
 * large enough to accommodate two full transmit packets,
@@ -2337,11 +2340,11 @@ void e1000e_reset(struct e1000_adapter *adapter)
 * the Rx FIFO should be large enough to accommodate at least
 * one full receive packet and is similarly rounded up and
 * expressed in KB. */
-   adapter-pba = er32(PBA);
+   pba = er32(PBA);
/* upper 16 bits has Tx packet buffer allocation size in KB */
-   tx_space = adapter-pba  16;
+   tx_space = pba  16;
/* lower 16 bits has Rx packet buffer allocation size in KB */
-   adapter-pba = 0x;
+   pba = 0x;
/* the tx fifo also stores 16 bytes of information about the tx
 * but don't include ethernet FCS because hardware appends it */
min_tx_space = (mac-max_frame_size +
@@ -2357,20 +2360,21 @@ void e1000e_reset(struct e1000_adapter *adapter)
/* If current Tx allocation is less than the min Tx FIFO size,
 * and the min Tx FIFO size is less than the current Rx FIFO
 * allocation, take space away from current Rx allocation */
-   if (tx_space  min_tx_space 
-   ((min_tx_space - tx_space)  adapter-pba)) {
-   adapter-pba -= - (min_tx_space - tx_space);
+   if ((tx_space  min_tx_space) 
+   ((min_tx_space - tx_space)  pba)) {
+   pba -= min_tx_space - tx_space;
 
/* if short on rx space, rx wins and must trump tx
 * adjustment or use Early Receive if available */
-   if ((adapter-pba  min_rx_space) 
+   if ((pba  min_rx_space) 
(!(adapter-flags  FLAG_HAS_ERT)))
/* ERT enabled in e1000_configure_rx */
-   adapter-pba = min_rx_space;
+   pba = min_rx_space;
}
+
+   ew32(PBA, pba);
}
 
-   ew32(PBA, adapter-pba);
 
/* flow control settings */
/* The high water mark must be low enough to fit one full frame
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iwl4965: fix driver hang related to hardware scan

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=052c4b9f0a83a83f3fee735b57c5b1e4edc1da8c
Commit: 052c4b9f0a83a83f3fee735b57c5b1e4edc1da8c
Parent: 702004b7455e0c4dcf875dd2f638d611892ea84f
Author: mabbas [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 17:15:43 2007 +0800
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:15:43 2007 -0400

[PATCH] iwl4965: fix driver hang related to hardware scan

This patch fix the following:
1. make sure we are not scanning before we call REPLY_RXON
2. set RXON_FILTER_ASSOC_MSK only after we receive association response
3. call scan abort on scan watchdog instead of restart

Signed-off-by: Mohamed Abbas [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl-4965.c |2 +-
 drivers/net/wireless/iwlwifi/iwl4965-base.c |   24 
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c 
b/drivers/net/wireless/iwlwifi/iwl-4965.c
index 4073367..891f90d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -3870,7 +3870,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv,
 */
case IEEE80211_STYPE_ASSOC_RESP:
case IEEE80211_STYPE_REASSOC_RESP:
-   if (network_packet  iwl_is_associated(priv)) {
+   if (network_packet) {
 #ifdef CONFIG_IWLWIFI_HT
u8 *pos = NULL;
struct ieee802_11_elems elems;
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c 
b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 5e12792..27b8569 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6845,8 +6845,9 @@ static void iwl_bg_scan_check(struct work_struct *data)
IWL_DEBUG(IWL_DL_INFO | IWL_DL_SCAN,
  Scan completion watchdog resetting adapter (%dms)\n,
  jiffies_to_msecs(IWL_SCAN_CHECK_WATCHDOG));
+
if (!test_bit(STATUS_EXIT_PENDING, priv-status))
-   queue_work(priv-workqueue, priv-restart);
+   iwl_send_scan_abort(priv);
}
mutex_unlock(priv-mutex);
 }
@@ -6942,7 +6943,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
spin_unlock_irqrestore(priv-lock, flags);
 
scan-suspend_time = 0;
-   scan-max_out_time = cpu_to_le32(600 * 1024);
+   scan-max_out_time = cpu_to_le32(200 * 1024);
if (!interval)
interval = suspend_time;
 
@@ -7118,6 +7119,8 @@ static void iwl_bg_post_associate(struct work_struct 
*data)
 
mutex_lock(priv-mutex);
 
+   iwl_scan_cancel_timeout(priv, 200);
+
conf = ieee80211_get_hw_conf(priv-hw);
 
priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
@@ -7573,8 +7576,6 @@ static int iwl_mac_config_interface(struct ieee80211_hw 
*hw, int if_id,
if (priv-iw_mode == IEEE80211_IF_TYPE_AP)
iwl_config_ap(priv);
else {
-   priv-staging_rxon.filter_flags |=
-   RXON_FILTER_ASSOC_MSK;
rc = iwl_commit_rxon(priv);
if ((priv-iw_mode == IEEE80211_IF_TYPE_STA)  rc)
iwl_rxon_add_station(
@@ -7582,6 +7583,7 @@ static int iwl_mac_config_interface(struct ieee80211_hw 
*hw, int if_id,
}
 
} else {
+   iwl_scan_cancel_timeout(priv, 100);
priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
iwl_commit_rxon(priv);
}
@@ -7642,6 +7644,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
 
IWL_DEBUG_MAC80211(enter\n);
 
+   mutex_lock(priv-mutex);
spin_lock_irqsave(priv-lock, flags);
 
if (!iwl_is_ready_rf(priv)) {
@@ -7680,6 +7683,7 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
 
 out_unlock:
spin_unlock_irqrestore(priv-lock, flags);
+   mutex_unlock(priv-mutex);
 
return rc;
 }
@@ -7713,6 +7717,8 @@ static int iwl_mac_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
 
mutex_lock(priv-mutex);
 
+   iwl_scan_cancel_timeout(priv, 100);
+
switch (cmd) {
case  SET_KEY:
rc = iwl_update_sta_key_info(priv, key, sta_id);
@@ -7903,8 +7909,18 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
 
spin_unlock_irqrestore(priv-lock, flags);
 
+   /* we are restarting association process
+* clear RXON_FILTER_ASSOC_MSK bit
+*/
+   if (priv-iw_mode 

[PATCH] iwl3945: fix direct scan problem

2007-10-29 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ef89d0afabe472dd17caff85cec2f9cefeb5f06
Commit: 6ef89d0afabe472dd17caff85cec2f9cefeb5f06
Parent: 15e869d86ee349f5510cf93f6b61e3a5e415c35f
Author: Mohamed Abbas [EMAIL PROTECTED]
AuthorDate: Thu Oct 25 17:15:47 2007 +0800
Committer:  John W. Linville [EMAIL PROTECTED]
CommitDate: Thu Oct 25 22:24:49 2007 -0400

[PATCH] iwl3945: fix direct scan problem

This patch fix the follwing for 3945:
1. Fix direct scan by make sure we set one_direct_scan only when the
   mac80211 ask for direct scan.
2. Fix mac_stop and mac_remove_interface calles, we make sure we cancel any
   scan and disassoc on these call

Signed-off-by: Mohamed Abbas [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
Signed-off-by: John W. Linville [EMAIL PROTECTED]
---
 drivers/net/wireless/iwlwifi/iwl3945-base.c |   32 +++---
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c 
b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index f1e1939..4f22a71 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6606,7 +6606,7 @@ static void iwl_bg_request_scan(struct work_struct *data)
memcpy(scan-direct_scan[0].ssid,
   priv-direct_ssid, priv-direct_ssid_len);
direct_mask = 1;
-   } else if (!iwl_is_associated(priv)) {
+   } else if (!iwl_is_associated(priv)  priv-essid_len) {
scan-direct_scan[0].id = WLAN_EID_SSID;
scan-direct_scan[0].len = priv-essid_len;
memcpy(scan-direct_scan[0].ssid, priv-essid, priv-essid_len);
@@ -6745,6 +6745,10 @@ static void iwl_bg_post_associate(struct work_struct 
*data)
 
mutex_lock(priv-mutex);
 
+   if (!priv-interface_id || !priv-is_open) {
+   mutex_unlock(priv-mutex);
+   return;
+   }
iwl_scan_cancel_timeout(priv, 200);
 
conf = ieee80211_get_hw_conf(priv-hw);
@@ -6885,9 +6889,19 @@ static void iwl_mac_stop(struct ieee80211_hw *hw)
struct iwl_priv *priv = hw-priv;
 
IWL_DEBUG_MAC80211(enter\n);
+
+
+   mutex_lock(priv-mutex);
+   /* stop mac, cancel any scan request and clear
+* RXON_FILTER_ASSOC_MSK BIT
+*/
priv-is_open = 0;
-   /*netif_stop_queue(dev); */
-   flush_workqueue(priv-workqueue);
+   iwl_scan_cancel_timeout(priv, 100);
+   cancel_delayed_work(priv-post_associate);
+   priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
+   iwl_commit_rxon(priv);
+   mutex_unlock(priv-mutex);
+
IWL_DEBUG_MAC80211(leave\n);
 }
 
@@ -7219,6 +7233,12 @@ static void iwl_mac_remove_interface(struct ieee80211_hw 
*hw,
IWL_DEBUG_MAC80211(enter\n);
 
mutex_lock(priv-mutex);
+
+   iwl_scan_cancel_timeout(priv, 100);
+   cancel_delayed_work(priv-post_associate);
+   priv-staging_rxon.filter_flags = ~RXON_FILTER_ASSOC_MSK;
+   iwl_commit_rxon(priv);
+
if (priv-interface_id == conf-if_id) {
priv-interface_id = 0;
memset(priv-bssid, 0, ETH_ALEN);
@@ -7271,7 +7291,8 @@ static int iwl_mac_hw_scan(struct ieee80211_hw *hw, u8 
*ssid, size_t len)
priv-direct_ssid_len = (u8)
min((u8) len, (u8) IW_ESSID_MAX_SIZE);
memcpy(priv-direct_ssid, ssid, priv-direct_ssid_len);
-   }
+   } else
+   priv-one_direct_scan = 0;
 
rc = iwl_scan_initiate(priv);
 
@@ -8574,6 +8595,9 @@ static void iwl_pci_remove(struct pci_dev *pdev)
iwl_rate_control_unregister(priv-hw);
}
 
+   /*netif_stop_queue(dev); */
+   flush_workqueue(priv-workqueue);
+
/* ieee80211_unregister_hw calls iwl_mac_stop, which flushes
 * priv-workqueue... so we can't take down the workqueue
 * until now... */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   >