* [U-Boot] [PATCH v4 2/2] NS16550: buffer reads
From: Wolfgang Denk @ 2011-10-23 17:15 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CALButCLEg6c30En3N4LjPv1woJjFxwkEkHvQYMoJy8+MgSzqJw@mail.gmail.com>
Dear Graeme Russ,
In message <CALButCLEg6c30En3N4LjPv1woJjFxwkEkHvQYMoJy8+MgSzqJw@mail.gmail.com> you wrote:
>
> > It should be sufficient to send XOFF after receiving a newline
> > character.
>
> And, ergo, we send an XON when entering the readline function
This is probably not sufficient, as some commands take direct input.
I think both getc() and tstc() should check the XON/XOFF state and
send a XON if XOFF was sent before.
> Hmm, should we move readline() into console.c
Makes sense.
> > This should not be necessary. Actually the implementation should not
> > need to know about such special cases.
>
> So how does kermit/ymodem send the XON after the user has entered the
> receive command and we have sent the XOFF after the newline?
Upon the first getc() that follows?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Marriage is the sole cause of divorce.
^ permalink raw reply
* [PATCH staging 5/6] et131x: kiss netdev.{base_addr, irq} goodbye.
From: Francois Romieu @ 2011-10-23 17:12 UTC (permalink / raw)
To: Mark Einon; +Cc: Greg KH, devel, linux-kernel
In-Reply-To: <20111023094231.GA3409@msilap.einon>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/staging/et131x/et131x.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 46de73b..79ca1d3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4366,10 +4366,6 @@ static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
adapter->pdev = pci_dev_get(pdev);
adapter->netdev = netdev;
- /* Do the same for the netdev struct */
- netdev->irq = pdev->irq;
- netdev->base_addr = pci_resource_start(pdev, 0);
-
/* Initialize spinlocks here */
spin_lock_init(&adapter->lock);
spin_lock_init(&adapter->tcb_send_qlock);
@@ -4828,8 +4824,10 @@ static struct net_device_stats *et131x_stats(struct net_device *netdev)
*/
static int et131x_open(struct net_device *netdev)
{
- int result = 0;
struct et131x_adapter *adapter = netdev_priv(netdev);
+ struct pci_dev *pdev = adapter->pdev;
+ unsigned int irq = pdev->irq;
+ int result;
/* Start the timer to track NIC errors */
init_timer(&adapter->error_timer);
@@ -4838,12 +4836,9 @@ static int et131x_open(struct net_device *netdev)
adapter->error_timer.data = (unsigned long)adapter;
add_timer(&adapter->error_timer);
- /* Register our IRQ */
- result = request_irq(netdev->irq, et131x_isr, IRQF_SHARED,
- netdev->name, netdev);
+ result = request_irq(irq, et131x_isr, IRQF_SHARED, netdev->name, netdev);
if (result) {
- dev_err(&adapter->pdev->dev, "could not register IRQ %d\n",
- netdev->irq);
+ dev_err(&pdev->dev, "could not register IRQ %d\n", irq);
return result;
}
@@ -4867,7 +4862,7 @@ static int et131x_close(struct net_device *netdev)
et131x_down(netdev);
adapter->flags &= ~fMP_ADAPTER_INTERRUPT_IN_USE;
- free_irq(netdev->irq, netdev);
+ free_irq(adapter->pdev->irq, netdev);
/* Stop the error timer */
return del_timer_sync(&adapter->error_timer);
--
1.7.6.4
^ permalink raw reply related
* [ath9k-devel] Can't associate with a particular AP
From: Julien Valroff @ 2011-10-23 17:15 UTC (permalink / raw)
To: ath9k-devel
In-Reply-To: <20111023165207.16449.qmail@stuge.se>
Le dimanche 23 oct. 2011 ? 18:52:07 (+0200 CEST), Peter Stuge a ?crit?:
> Julien Valroff wrote:
> > > I think it is important to iwconfig eth1 mode monitor before you run
> > > ip link set dev eth1 up, and once you have done that it does not
> > > matter what settings wireshark does or does not do, the mode can't be
> > > changed when the interface is up, so just starting the capture should
> > > work.
> >
> > I couldn't capture anything this way from the other laptops.
>
> How does it fail?
No error, simply no packet being capture.
> > > > Cell 01 - Address: BA:F4:8A:C6:C8:44
> > > ..
> > > > Cell 04 - Address: C6:6E:27:A6:BE:A4
> > >
> > > Which is the actual correct address of your AP? I would expect
> > > c6-6e-27, but the IEEE OUI listing does not have a match for it!
> >
> > I would also say that, given what I can see from the other laptops.
>
> I would check the sticker on the AP.
The only MAC being stated on the sticker is the one for the ethernet
interface (as explained, it is the router of my internet provider).
[...]
> > as I have no problem with the same AP with other
> > laptops/smartphones.
>
> The other laptops likely have different hardware and software. If you
> want you can gather more data by comparing results while you
> eliminate those differences one at a time.
I'll do this.
> > > I would try FreeBSD on that machine. I believe the driver there is
> > > more reliable, and using it can allow you to get more concrete help
> > > from Adrian in case the problem is seen also there.
> >
> > I will try something like a livecd,
>
> Might work, but by doing that you are only adding more parameters,
> which is absolutely counter-productive for debugging.
That's just a more convenient way to start.
> > I do not want to install FreeBSD.
>
> This is stupid. Either you want to resolve the problem or you do not.
> If you do not then you would not have posted to the list. If
> installing FreeBSD can help identify the problem then that is
> obviously what you should do.
I can do that, but this will have to wait - as I'd like to supply as many
details as possible, I'd thought that
> > Or it could be a good opportunity to test Debian GNU/kFreeBSD ;)
>
> Again a really bad idea. The purpose of using FreeBSD would be to
> get another data point, and to take advantage of Adrian's expertise.
See the smiley at the end of my sentence
> The only way of doing that which makes sense is to use exactly the
> same code that Adrian has; which means you should build the very
> latest fbsd world and kernel, and see what happens. This should be
> really easy given that you have experience from distribution
> development already. Also, this should be absolutely obvious to you
> already. I'm surprised I have to explain it.
>
> It's simple: Either you want to try to identify the problem, or you
> don't care so much. If you don't care then you can't expect anyone
> else to, and the problem will stay unresolved. You have an
> opportunity to improve ath9k for the benefit of all, and you do not
> want to do it because you would have to install FreeBSD? lolwut?
I have absolutely *no* experience with FreeBSD, and we are talking about my
main laptop, the data of which I need everyday. Before installing FreeBSD, I
need to move 500Gb to another computer which I do not have on hand, this
explains why I am reluctant to install FreeBSD /now/.
Sorry if I haven't understood your initial request, I had considered it as a
"give it a try and see if it works"?
Cheers,
Julien
--
.''`. Julien Valroff ~ <julien@kirya.net> ~ <julien@debian.org>
: :' : Debian Developer & Free software contributor
`. `'` http://www.kirya.net/
`- 4096R/ E1D8 5796 8214 4687 E416 948C 859F EF67 258E 26B1
^ permalink raw reply
* [PATCH staging 4/6] et131x: remove extraneous pci_save_state.
From: Francois Romieu @ 2011-10-23 17:11 UTC (permalink / raw)
To: Mark Einon; +Cc: Greg KH, devel, linux-kernel
In-Reply-To: <20111023094231.GA3409@msilap.einon>
pci_{save, restore}_state are balanced in .suspend and .resume.
They are not used anywhere else in the driver.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/staging/et131x/et131x.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 2b6ca6a..46de73b 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -5423,7 +5423,6 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
* been initialized, just in case it needs to be quickly restored.
*/
pci_set_drvdata(pdev, netdev);
- pci_save_state(adapter->pdev);
out:
return rc;
--
1.7.6.4
^ permalink raw reply related
* [PATCH staging 3/6] et131x: fix error paths in et131x_pci_setup.
From: Francois Romieu @ 2011-10-23 17:11 UTC (permalink / raw)
To: Mark Einon; +Cc: Greg KH, devel, linux-kernel
In-Reply-To: <20111023094231.GA3409@msilap.einon>
Wrong status code and unbalanced phy_connect.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/staging/et131x/et131x.c | 99 +++++++++++++++------------------------
1 files changed, 38 insertions(+), 61 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 2ae7819..2b6ca6a 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -4402,6 +4402,7 @@ static void __devexit et131x_pci_remove(struct pci_dev *pdev)
struct et131x_adapter *adapter = netdev_priv(netdev);
unregister_netdev(netdev);
+ phy_disconnect(adapter->phydev);
mdiobus_unregister(adapter->mii_bus);
kfree(adapter->mii_bus->irq);
mdiobus_free(adapter->mii_bus);
@@ -5245,40 +5246,6 @@ static const struct net_device_ops et131x_netdev_ops = {
};
/**
- * et131x_device_alloc
- *
- * Returns pointer to the allocated and initialized net_device struct for
- * this device.
- *
- * Create instances of net_device and wl_private for the new adapter and
- * register the device's entry points in the net_device structure.
- */
-struct net_device *et131x_device_alloc(void)
-{
- struct net_device *netdev;
-
- /* Alloc net_device and adapter structs */
- netdev = alloc_etherdev(sizeof(struct et131x_adapter));
-
- if (!netdev) {
- printk(KERN_ERR "et131x: Alloc of net_device struct failed\n");
- return NULL;
- }
-
- /*
- * Setup the function registration table (and other data) for a
- * net_device
- */
- netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
- netdev->netdev_ops = &et131x_netdev_ops;
-
- /* Poll? */
- /* netdev->poll = &et131x_poll; */
- /* netdev->poll_controller = &et131x_poll_controller; */
- return netdev;
-}
-
-/**
* et131x_pci_setup - Perform device initialization
* @pdev: a pointer to the device's pci_dev structure
* @ent: this device's entry in the pci_device_id table
@@ -5293,24 +5260,26 @@ struct net_device *et131x_device_alloc(void)
static int __devinit et131x_pci_setup(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
- int result;
struct net_device *netdev;
struct et131x_adapter *adapter;
+ int rc;
int ii;
- result = pci_enable_device(pdev);
- if (result) {
+ rc = pci_enable_device(pdev);
+ if (rc < 0) {
dev_err(&pdev->dev, "pci_enable_device() failed\n");
- goto err_out;
+ goto out;
}
/* Perform some basic PCI checks */
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
dev_err(&pdev->dev, "Can't find PCI device's base address\n");
+ rc = -ENODEV;
goto err_disable;
}
- if (pci_request_regions(pdev, DRIVER_NAME)) {
+ rc = pci_request_regions(pdev, DRIVER_NAME);
+ if (rc < 0) {
dev_err(&pdev->dev, "Can't get PCI resources\n");
goto err_disable;
}
@@ -5319,46 +5288,50 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
/* Check the DMA addressing support of this device */
if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64))) {
- result = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
- if (result) {
+ rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
+ if (rc < 0) {
dev_err(&pdev->dev,
"Unable to obtain 64 bit DMA for consistent allocations\n");
goto err_release_res;
}
} else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) {
- result = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
- if (result) {
+ rc = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
+ if (rc < 0) {
dev_err(&pdev->dev,
"Unable to obtain 32 bit DMA for consistent allocations\n");
goto err_release_res;
}
} else {
dev_err(&pdev->dev, "No usable DMA addressing method\n");
- result = -EIO;
+ rc = -EIO;
goto err_release_res;
}
/* Allocate netdev and private adapter structs */
- netdev = et131x_device_alloc();
+ netdev = alloc_etherdev(sizeof(struct et131x_adapter));
if (!netdev) {
dev_err(&pdev->dev, "Couldn't alloc netdev struct\n");
- result = -ENOMEM;
+ rc = -ENOMEM;
goto err_release_res;
}
+ netdev->watchdog_timeo = ET131X_TX_TIMEOUT;
+ netdev->netdev_ops = &et131x_netdev_ops;
+
SET_NETDEV_DEV(netdev, &pdev->dev);
et131x_set_ethtool_ops(netdev);
adapter = et131x_adapter_init(netdev, pdev);
- /* Initialise the PCI setup for the device */
- et131x_pci_init(adapter, pdev);
+ rc = et131x_pci_init(adapter, pdev);
+ if (rc < 0)
+ goto err_free_dev;
/* Map the bus-relative registers to system virtual memory */
adapter->regs = pci_ioremap_bar(pdev, 0);
if (!adapter->regs) {
dev_err(&pdev->dev, "Cannot map device registers\n");
- result = -ENOMEM;
+ rc = -ENOMEM;
goto err_free_dev;
}
@@ -5372,8 +5345,8 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
et131x_disable_interrupts(adapter);
/* Allocate DMA memory */
- result = et131x_adapter_memory_alloc(adapter);
- if (result) {
+ rc = et131x_adapter_memory_alloc(adapter);
+ if (rc < 0) {
dev_err(&pdev->dev, "Could not alloc adapater memory (DMA)\n");
goto err_iounmap;
}
@@ -5391,6 +5364,8 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
adapter->boot_coma = 0;
et1310_disable_phy_coma(adapter);
+ rc = -ENOMEM;
+
/* Setup the mii_bus struct */
adapter->mii_bus = mdiobus_alloc();
if (!adapter->mii_bus) {
@@ -5414,13 +5389,14 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
for (ii = 0; ii < PHY_MAX_ADDR; ii++)
adapter->mii_bus->irq[ii] = PHY_POLL;
- if (mdiobus_register(adapter->mii_bus)) {
+ rc = mdiobus_register(adapter->mii_bus);
+ if (rc < 0) {
dev_err(&pdev->dev, "failed to register MII bus\n");
- mdiobus_free(adapter->mii_bus);
goto err_mdio_free_irq;
}
- if (et131x_mii_probe(netdev)) {
+ rc = et131x_mii_probe(netdev);
+ if (rc < 0) {
dev_err(&pdev->dev, "failed to probe MII bus\n");
goto err_mdio_unregister;
}
@@ -5436,10 +5412,10 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
*/
/* Register the net_device struct with the Linux network layer */
- result = register_netdev(netdev);
- if (result != 0) {
+ rc = register_netdev(netdev);
+ if (rc < 0) {
dev_err(&pdev->dev, "register_netdev() failed\n");
- goto err_mdio_unregister;
+ goto err_phy_disconnect;
}
/* Register the net_device struct with the PCI subsystem. Save a copy
@@ -5448,9 +5424,11 @@ static int __devinit et131x_pci_setup(struct pci_dev *pdev,
*/
pci_set_drvdata(pdev, netdev);
pci_save_state(adapter->pdev);
+out:
+ return rc;
- return result;
-
+err_phy_disconnect:
+ phy_disconnect(adapter->phydev);
err_mdio_unregister:
mdiobus_unregister(adapter->mii_bus);
err_mdio_free_irq:
@@ -5468,8 +5446,7 @@ err_release_res:
pci_release_regions(pdev);
err_disable:
pci_disable_device(pdev);
-err_out:
- return result;
+ goto out;
}
static SIMPLE_DEV_PM_OPS(et131x_pm_ops, et131x_suspend, et131x_resume);
--
1.7.6.4
^ permalink raw reply related
* [PATCH staging 2/6] et131x: uintxy_t removal.
From: Francois Romieu @ 2011-10-23 17:11 UTC (permalink / raw)
To: Mark Einon; +Cc: Greg KH, devel, linux-kernel
In-Reply-To: <20111023094231.GA3409@msilap.einon>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/staging/et131x/et131x.c | 53 ++++++++++++++++++++-------------------
1 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 06960f3..2ae7819 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -303,8 +303,8 @@ struct fbr_lookup {
dma_addr_t ring_physaddr;
void *mem_virtaddrs[MAX_DESC_PER_RING_RX / FBR_CHUNKS];
dma_addr_t mem_physaddrs[MAX_DESC_PER_RING_RX / FBR_CHUNKS];
- uint64_t real_physaddr;
- uint64_t offset;
+ dma_addr_t real_physaddr;
+ u32 offset;
u32 local_full;
u32 num_entries;
u32 buffsize;
@@ -1117,12 +1117,10 @@ static int et1310_in_phy_coma(struct et131x_adapter *adapter)
static void et1310_setup_device_for_multicast(struct et131x_adapter *adapter)
{
struct rxmac_regs __iomem *rxmac = &adapter->regs->rxmac;
- uint32_t nIndex;
- uint32_t result;
- uint32_t hash1 = 0;
- uint32_t hash2 = 0;
- uint32_t hash3 = 0;
- uint32_t hash4 = 0;
+ u32 hash1 = 0;
+ u32 hash2 = 0;
+ u32 hash3 = 0;
+ u32 hash4 = 0;
u32 pm_csr;
/* If ET131X_PACKET_TYPE_MULTICAST is specified, then we provision
@@ -1131,10 +1129,13 @@ static void et1310_setup_device_for_multicast(struct et131x_adapter *adapter)
* driver.
*/
if (adapter->packet_filter & ET131X_PACKET_TYPE_MULTICAST) {
+ int i;
+
/* Loop through our multicast array and set up the device */
- for (nIndex = 0; nIndex < adapter->multicast_addr_count;
- nIndex++) {
- result = ether_crc(6, adapter->multicast_list[nIndex]);
+ for (i = 0; i < adapter->multicast_addr_count; i++) {
+ u32 result;
+
+ result = ether_crc(6, adapter->multicast_list[i]);
result = (result & 0x3F800000) >> 23;
@@ -1925,9 +1926,10 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
/* Set the address and parameters of Free buffer ring 1 (and 0 if
* required) into the 1310's registers
*/
- writel((u32) (rx_local->fbr[0]->real_physaddr >> 32),
+ writel(((u64) rx_local->fbr[0]->real_physaddr) >> 32,
&rx_dma->fbr1_base_hi);
- writel((u32) rx_local->fbr[0]->real_physaddr, &rx_dma->fbr1_base_lo);
+ writel(((u64) rx_local->fbr[0]->real_physaddr) & DMA_BIT_MASK(32),
+ &rx_dma->fbr1_base_lo);
writel(rx_local->fbr[0]->num_entries - 1, &rx_dma->fbr1_num_des);
writel(ET_DMA10_WRAP, &rx_dma->fbr1_full_offset);
@@ -1949,9 +1951,10 @@ static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
fbr_entry++;
}
- writel((u32) (rx_local->fbr[1]->real_physaddr >> 32),
+ writel(((u64) rx_local->fbr[1]->real_physaddr) >> 32,
&rx_dma->fbr0_base_hi);
- writel((u32) rx_local->fbr[1]->real_physaddr, &rx_dma->fbr0_base_lo);
+ writel(((u64) rx_local->fbr[1]->real_physaddr) & DMA_BIT_MASK(32),
+ &rx_dma->fbr0_base_lo);
writel(rx_local->fbr[1]->num_entries - 1, &rx_dma->fbr0_num_des);
writel(ET_DMA10_WRAP, &rx_dma->fbr0_full_offset);
@@ -2298,15 +2301,13 @@ static inline u32 bump_free_buff_ring(u32 *free_buff_ring, u32 limit)
* @mask: correct mask
*/
static void et131x_align_allocated_memory(struct et131x_adapter *adapter,
- uint64_t *phys_addr,
- uint64_t *offset, uint64_t mask)
+ dma_addr_t *phys_addr, u32 *offset,
+ u32 mask)
{
- uint64_t new_addr;
+ dma_addr_t new_addr = *phys_addr & ~mask;
*offset = 0;
- new_addr = *phys_addr & ~mask;
-
if (new_addr != *phys_addr) {
/* Move to next aligned block */
new_addr += mask + 1;
@@ -2455,8 +2456,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
rx_ring->fbr[1]->offset);
#endif
for (i = 0; i < (rx_ring->fbr[0]->num_entries / FBR_CHUNKS); i++) {
- u64 fbr1_offset;
- u64 fbr1_tmp_physaddr;
+ dma_addr_t fbr1_tmp_physaddr;
+ u32 fbr1_offset;
u32 fbr1_align;
/* This code allocates an area of memory big enough for N
@@ -2521,8 +2522,8 @@ static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
#ifdef USE_FBR0
/* Same for FBR0 (if in use) */
for (i = 0; i < (rx_ring->fbr[1]->num_entries / FBR_CHUNKS); i++) {
- u64 fbr0_offset;
- u64 fbr0_tmp_physaddr;
+ dma_addr_t fbr0_tmp_physaddr;
+ u32 fbr0_offset;
fbr_chunksize =
((FBR_CHUNKS + 1) * rx_ring->fbr[1]->buffsize) - 1;
@@ -4900,8 +4901,8 @@ static int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf,
*/
static int et131x_set_packet_filter(struct et131x_adapter *adapter)
{
+ int filter = adapter->packet_filter;
int status = 0;
- uint32_t filter = adapter->packet_filter;
u32 ctrl;
u32 pf_ctrl;
@@ -4963,7 +4964,7 @@ static int et131x_set_packet_filter(struct et131x_adapter *adapter)
static void et131x_multicast(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
- uint32_t packet_filter = 0;
+ int packet_filter;
unsigned long flags;
struct netdev_hw_addr *ha;
int i;
--
1.7.6.4
^ permalink raw reply related
* [PATCH staging 1/6] et131x: add static qualifiers.
From: Francois Romieu @ 2011-10-23 17:11 UTC (permalink / raw)
To: Mark Einon; +Cc: Greg KH, devel, linux-kernel
In-Reply-To: <20111023094231.GA3409@msilap.einon>
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
---
drivers/staging/et131x/et131x.c | 119 ++++++++++++++++++++-------------------
1 files changed, 60 insertions(+), 59 deletions(-)
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 45b88d4..06960f3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -795,7 +795,7 @@ static int eeprom_read(struct et131x_adapter *adapter, u32 addr, u8 *pdata)
return (status & LBCIF_STATUS_ACK_ERROR) ? -EIO : 0;
}
-int et131x_init_eeprom(struct et131x_adapter *adapter)
+static int et131x_init_eeprom(struct et131x_adapter *adapter)
{
struct pci_dev *pdev = adapter->pdev;
u8 eestatus;
@@ -868,7 +868,7 @@ int et131x_init_eeprom(struct et131x_adapter *adapter)
* et131x_rx_dma_enable - re-start of Rx_DMA on the ET1310.
* @adapter: pointer to our adapter structure
*/
-void et131x_rx_dma_enable(struct et131x_adapter *adapter)
+static void et131x_rx_dma_enable(struct et131x_adapter *adapter)
{
/* Setup the receive dma configuration register for normal operation */
u32 csr = 0x2000; /* FBR1 enable */
@@ -906,7 +906,7 @@ void et131x_rx_dma_enable(struct et131x_adapter *adapter)
* et131x_rx_dma_disable - Stop of Rx_DMA on the ET1310
* @adapter: pointer to our adapter structure
*/
-void et131x_rx_dma_disable(struct et131x_adapter *adapter)
+static void et131x_rx_dma_disable(struct et131x_adapter *adapter)
{
u32 csr;
/* Setup the receive dma configuration register */
@@ -928,7 +928,7 @@ void et131x_rx_dma_disable(struct et131x_adapter *adapter)
*
* Mainly used after a return to the D0 (full-power) state from a lower state.
*/
-void et131x_tx_dma_enable(struct et131x_adapter *adapter)
+static void et131x_tx_dma_enable(struct et131x_adapter *adapter)
{
/* Setup the transmit dma configuration register for normal
* operation
@@ -964,7 +964,7 @@ static inline void add_12bit(u32 *v, int n)
* et1310_config_mac_regs1 - Initialize the first part of MAC regs
* @adapter: pointer to our adapter structure
*/
-void et1310_config_mac_regs1(struct et131x_adapter *adapter)
+static void et1310_config_mac_regs1(struct et131x_adapter *adapter)
{
struct mac_regs __iomem *macregs = &adapter->regs->mac;
u32 station1;
@@ -1024,7 +1024,7 @@ void et1310_config_mac_regs1(struct et131x_adapter *adapter)
* et1310_config_mac_regs2 - Initialize the second part of MAC regs
* @adapter: pointer to our adapter structure
*/
-void et1310_config_mac_regs2(struct et131x_adapter *adapter)
+static void et1310_config_mac_regs2(struct et131x_adapter *adapter)
{
int32_t delay = 0;
struct mac_regs __iomem *mac = &adapter->regs->mac;
@@ -1105,7 +1105,7 @@ void et1310_config_mac_regs2(struct et131x_adapter *adapter)
*
* Returns 0 if the device is not in phy coma, 1 if it is in phy coma
*/
-int et1310_in_phy_coma(struct et131x_adapter *adapter)
+static int et1310_in_phy_coma(struct et131x_adapter *adapter)
{
u32 pmcsr;
@@ -1114,7 +1114,7 @@ int et1310_in_phy_coma(struct et131x_adapter *adapter)
return ET_PM_PHY_SW_COMA & pmcsr ? 1 : 0;
}
-void et1310_setup_device_for_multicast(struct et131x_adapter *adapter)
+static void et1310_setup_device_for_multicast(struct et131x_adapter *adapter)
{
struct rxmac_regs __iomem *rxmac = &adapter->regs->rxmac;
uint32_t nIndex;
@@ -1163,7 +1163,7 @@ void et1310_setup_device_for_multicast(struct et131x_adapter *adapter)
}
}
-void et1310_setup_device_for_unicast(struct et131x_adapter *adapter)
+static void et1310_setup_device_for_unicast(struct et131x_adapter *adapter)
{
struct rxmac_regs __iomem *rxmac = &adapter->regs->rxmac;
u32 uni_pf1;
@@ -1203,7 +1203,7 @@ void et1310_setup_device_for_unicast(struct et131x_adapter *adapter)
}
}
-void et1310_config_rxmac_regs(struct et131x_adapter *adapter)
+static void et1310_config_rxmac_regs(struct et131x_adapter *adapter)
{
struct rxmac_regs __iomem *rxmac = &adapter->regs->rxmac;
struct phy_device *phydev = adapter->phydev;
@@ -1334,7 +1334,7 @@ void et1310_config_rxmac_regs(struct et131x_adapter *adapter)
writel(0x9, &rxmac->ctrl);
}
-void et1310_config_txmac_regs(struct et131x_adapter *adapter)
+static void et1310_config_txmac_regs(struct et131x_adapter *adapter)
{
struct txmac_regs __iomem *txmac = &adapter->regs->txmac;
@@ -1348,7 +1348,7 @@ void et1310_config_txmac_regs(struct et131x_adapter *adapter)
writel(0x40, &txmac->cf_param);
}
-void et1310_config_macstat_regs(struct et131x_adapter *adapter)
+static void et1310_config_macstat_regs(struct et131x_adapter *adapter)
{
struct macstat_regs __iomem *macstat =
&adapter->regs->macstat;
@@ -1422,7 +1422,7 @@ void et1310_config_macstat_regs(struct et131x_adapter *adapter)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
+static int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
u8 reg, u16 *value)
{
struct mac_regs __iomem *mac = &adapter->regs->mac;
@@ -1478,7 +1478,7 @@ int et131x_phy_mii_read(struct et131x_adapter *adapter, u8 addr,
return status;
}
-int et131x_mii_read(struct et131x_adapter *adapter, u8 reg, u16 *value)
+static int et131x_mii_read(struct et131x_adapter *adapter, u8 reg, u16 *value)
{
struct phy_device *phydev = adapter->phydev;
@@ -1498,7 +1498,7 @@ int et131x_mii_read(struct et131x_adapter *adapter, u8 reg, u16 *value)
*
* Return 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_mii_write(struct et131x_adapter *adapter, u8 reg, u16 value)
+static int et131x_mii_write(struct et131x_adapter *adapter, u8 reg, u16 value)
{
struct mac_regs __iomem *mac = &adapter->regs->mac;
struct phy_device *phydev = adapter->phydev;
@@ -1564,8 +1564,9 @@ int et131x_mii_write(struct et131x_adapter *adapter, u8 reg, u16 value)
}
/* Still used from _mac for BIT_READ */
-void et1310_phy_access_mii_bit(struct et131x_adapter *adapter, u16 action,
- u16 regnum, u16 bitnum, u8 *value)
+static void et1310_phy_access_mii_bit(struct et131x_adapter *adapter,
+ u16 action, u16 regnum, u16 bitnum,
+ u8 *value)
{
u16 reg;
u16 mask = 0x0001 << bitnum;
@@ -1591,7 +1592,7 @@ void et1310_phy_access_mii_bit(struct et131x_adapter *adapter, u16 action,
}
}
-void et1310_config_flow_control(struct et131x_adapter *adapter)
+static void et1310_config_flow_control(struct et131x_adapter *adapter)
{
struct phy_device *phydev = adapter->phydev;
@@ -1632,7 +1633,7 @@ void et1310_config_flow_control(struct et131x_adapter *adapter)
* et1310_update_macstat_host_counters - Update the local copy of the statistics
* @adapter: pointer to the adapter structure
*/
-void et1310_update_macstat_host_counters(struct et131x_adapter *adapter)
+static void et1310_update_macstat_host_counters(struct et131x_adapter *adapter)
{
struct ce_stats *stats = &adapter->stats;
struct macstat_regs __iomem *macstat =
@@ -1664,7 +1665,7 @@ void et1310_update_macstat_host_counters(struct et131x_adapter *adapter)
* the statistics held in the adapter structure, checking the "wrap"
* bit for each counter.
*/
-void et1310_handle_macstat_interrupt(struct et131x_adapter *adapter)
+static void et1310_handle_macstat_interrupt(struct et131x_adapter *adapter)
{
u32 carry_reg1;
u32 carry_reg2;
@@ -1716,7 +1717,7 @@ void et1310_handle_macstat_interrupt(struct et131x_adapter *adapter)
/* PHY functions */
-int et131x_mdio_read(struct mii_bus *bus, int phy_addr, int reg)
+static int et131x_mdio_read(struct mii_bus *bus, int phy_addr, int reg)
{
struct net_device *netdev = bus->priv;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -1731,7 +1732,7 @@ int et131x_mdio_read(struct mii_bus *bus, int phy_addr, int reg)
return value;
}
-int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 value)
+static int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 value)
{
struct net_device *netdev = bus->priv;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -1739,7 +1740,7 @@ int et131x_mdio_write(struct mii_bus *bus, int phy_addr, int reg, u16 value)
return et131x_mii_write(adapter, reg, value);
}
-int et131x_mdio_reset(struct mii_bus *bus)
+static int et131x_mdio_reset(struct mii_bus *bus)
{
struct net_device *netdev = bus->priv;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -1759,7 +1760,7 @@ int et131x_mdio_reset(struct mii_bus *bus)
* Can't you see that this code processed
* Phy power, phy power..
*/
-void et1310_phy_power_down(struct et131x_adapter *adapter, bool down)
+static void et1310_phy_power_down(struct et131x_adapter *adapter, bool down)
{
u16 data;
@@ -1775,7 +1776,7 @@ void et1310_phy_power_down(struct et131x_adapter *adapter, bool down)
* @adapter: pointer to our private adapter structure
*
*/
-void et131x_xcvr_init(struct et131x_adapter *adapter)
+static void et131x_xcvr_init(struct et131x_adapter *adapter)
{
u16 imr;
u16 isr;
@@ -1822,7 +1823,7 @@ void et131x_xcvr_init(struct et131x_adapter *adapter)
*
* Used to configure the global registers on the JAGCore
*/
-void et131x_configure_global_regs(struct et131x_adapter *adapter)
+static void et131x_configure_global_regs(struct et131x_adapter *adapter)
{
struct global_regs __iomem *regs = &adapter->regs->global;
@@ -1869,7 +1870,7 @@ void et131x_configure_global_regs(struct et131x_adapter *adapter)
* et131x_config_rx_dma_regs - Start of Rx_DMA init sequence
* @adapter: pointer to our adapter structure
*/
-void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
+static void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
{
struct rxdma_regs __iomem *rx_dma = &adapter->regs->rxdma;
struct rx_ring *rx_local = &adapter->rx_ring;
@@ -1987,7 +1988,7 @@ void et131x_config_rx_dma_regs(struct et131x_adapter *adapter)
* Configure the transmit engine with the ring buffers we have created
* and prepare it for use.
*/
-void et131x_config_tx_dma_regs(struct et131x_adapter *adapter)
+static void et131x_config_tx_dma_regs(struct et131x_adapter *adapter)
{
struct txdma_regs __iomem *txdma = &adapter->regs->txdma;
@@ -2017,7 +2018,7 @@ void et131x_config_tx_dma_regs(struct et131x_adapter *adapter)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-void et131x_adapter_setup(struct et131x_adapter *adapter)
+static void et131x_adapter_setup(struct et131x_adapter *adapter)
{
/* Configure the JAGCore */
et131x_configure_global_regs(adapter);
@@ -2044,7 +2045,7 @@ void et131x_adapter_setup(struct et131x_adapter *adapter)
* et131x_soft_reset - Issue a soft reset to the hardware, complete for ET1310
* @adapter: pointer to our private adapter structure
*/
-void et131x_soft_reset(struct et131x_adapter *adapter)
+static void et131x_soft_reset(struct et131x_adapter *adapter)
{
/* Disable MAC Core */
writel(0xc00f0000, &adapter->regs->mac.cfg1);
@@ -2062,7 +2063,7 @@ void et131x_soft_reset(struct et131x_adapter *adapter)
* Enable the appropriate interrupts on the ET131x according to our
* configuration
*/
-void et131x_enable_interrupts(struct et131x_adapter *adapter)
+static void et131x_enable_interrupts(struct et131x_adapter *adapter)
{
u32 mask;
@@ -2082,7 +2083,7 @@ void et131x_enable_interrupts(struct et131x_adapter *adapter)
*
* Block all interrupts from the et131x device at the device itself
*/
-void et131x_disable_interrupts(struct et131x_adapter *adapter)
+static void et131x_disable_interrupts(struct et131x_adapter *adapter)
{
/* Disable all global interrupts */
writel(INT_MASK_DISABLE, &adapter->regs->global.int_mask);
@@ -2092,7 +2093,7 @@ void et131x_disable_interrupts(struct et131x_adapter *adapter)
* et131x_tx_dma_disable - Stop of Tx_DMA on the ET1310
* @adapter: pointer to our adapter structure
*/
-void et131x_tx_dma_disable(struct et131x_adapter *adapter)
+static void et131x_tx_dma_disable(struct et131x_adapter *adapter)
{
/* Setup the tramsmit dma configuration register */
writel(ET_TXDMA_CSR_HALT|ET_TXDMA_SNGL_EPKT,
@@ -2103,7 +2104,7 @@ void et131x_tx_dma_disable(struct et131x_adapter *adapter)
* et131x_enable_txrx - Enable tx/rx queues
* @netdev: device to be enabled
*/
-void et131x_enable_txrx(struct net_device *netdev)
+static void et131x_enable_txrx(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -2123,7 +2124,7 @@ void et131x_enable_txrx(struct net_device *netdev)
* et131x_disable_txrx - Disable tx/rx queues
* @netdev: device to be disabled
*/
-void et131x_disable_txrx(struct net_device *netdev)
+static void et131x_disable_txrx(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -2142,7 +2143,7 @@ void et131x_disable_txrx(struct net_device *netdev)
* et131x_init_send - Initialize send data structures
* @adapter: pointer to our private adapter structure
*/
-void et131x_init_send(struct et131x_adapter *adapter)
+static void et131x_init_send(struct et131x_adapter *adapter)
{
struct tcb *tcb;
u32 ct;
@@ -2192,7 +2193,7 @@ void et131x_init_send(struct et131x_adapter *adapter)
* indicating linkup status, call the MPDisablePhyComa routine to
* restore JAGCore and gigE PHY
*/
-void et1310_enable_phy_coma(struct et131x_adapter *adapter)
+static void et1310_enable_phy_coma(struct et131x_adapter *adapter)
{
unsigned long flags;
u32 pmcsr;
@@ -2231,7 +2232,7 @@ void et1310_enable_phy_coma(struct et131x_adapter *adapter)
* et1310_disable_phy_coma - Disable the Phy Coma Mode
* @adapter: pointer to our adapter structure
*/
-void et1310_disable_phy_coma(struct et131x_adapter *adapter)
+static void et1310_disable_phy_coma(struct et131x_adapter *adapter)
{
u32 pmcsr;
@@ -2296,7 +2297,7 @@ static inline u32 bump_free_buff_ring(u32 *free_buff_ring, u32 limit)
* @offset: pointer to the offset variable
* @mask: correct mask
*/
-void et131x_align_allocated_memory(struct et131x_adapter *adapter,
+static void et131x_align_allocated_memory(struct et131x_adapter *adapter,
uint64_t *phys_addr,
uint64_t *offset, uint64_t mask)
{
@@ -2325,7 +2326,7 @@ void et131x_align_allocated_memory(struct et131x_adapter *adapter,
* Allocates Free buffer ring 1 for sure, free buffer ring 0 if required,
* and the Packet Status Ring.
*/
-int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
+static int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
{
u32 i, j;
u32 bufsize;
@@ -2629,7 +2630,7 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
* et131x_rx_dma_memory_free - Free all memory allocated within this module.
* @adapter: pointer to our private adapter structure
*/
-void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
+static void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
{
u32 index;
u32 bufsize;
@@ -2774,7 +2775,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
*
* Returns 0 on success and errno on failure (as defined in errno.h)
*/
-int et131x_init_recv(struct et131x_adapter *adapter)
+static int et131x_init_recv(struct et131x_adapter *adapter)
{
int status = -ENOMEM;
struct rfd *rfd = NULL;
@@ -2824,7 +2825,7 @@ int et131x_init_recv(struct et131x_adapter *adapter)
* et131x_set_rx_dma_timer - Set the heartbeat timer according to line rate.
* @adapter: pointer to our adapter structure
*/
-void et131x_set_rx_dma_timer(struct et131x_adapter *adapter)
+static void et131x_set_rx_dma_timer(struct et131x_adapter *adapter)
{
struct phy_device *phydev = adapter->phydev;
@@ -3139,7 +3140,7 @@ static struct rfd *nic_rx_pkts(struct et131x_adapter *adapter)
*
* Assumption, Rcv spinlock has been acquired.
*/
-void et131x_handle_recv_interrupt(struct et131x_adapter *adapter)
+static void et131x_handle_recv_interrupt(struct et131x_adapter *adapter)
{
struct rfd *rfd = NULL;
u32 count = 0;
@@ -3202,7 +3203,7 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *adapter)
* memory. The device will update the "status" in memory each time it xmits a
* packet.
*/
-int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
+static int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
{
int desc_size = 0;
struct tx_ring *tx_ring = &adapter->tx_ring;
@@ -3256,7 +3257,7 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
*
* Returns 0 on success and errno on failure (as defined in errno.h).
*/
-void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
+static void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
{
int desc_size = 0;
@@ -3578,7 +3579,7 @@ static int send_packet(struct sk_buff *skb, struct et131x_adapter *adapter)
*
* Return 0 in almost all cases; non-zero value in extreme hard failure only
*/
-int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
+static int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
{
int status = 0;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -3696,7 +3697,7 @@ static inline void free_send_packet(struct et131x_adapter *adapter,
*
* Assumption - Send spinlock has been acquired
*/
-void et131x_free_busy_send_packets(struct et131x_adapter *adapter)
+static void et131x_free_busy_send_packets(struct et131x_adapter *adapter)
{
struct tcb *tcb;
unsigned long flags;
@@ -3743,7 +3744,7 @@ void et131x_free_busy_send_packets(struct et131x_adapter *adapter)
*
* Assumption - Send spinlock has been acquired
*/
-void et131x_handle_send_interrupt(struct et131x_adapter *adapter)
+static void et131x_handle_send_interrupt(struct et131x_adapter *adapter)
{
unsigned long flags;
u32 serviced;
@@ -3965,7 +3966,7 @@ static struct ethtool_ops et131x_ethtool_ops = {
.get_link = ethtool_op_get_link,
};
-void et131x_set_ethtool_ops(struct net_device *netdev)
+static void et131x_set_ethtool_ops(struct net_device *netdev)
{
SET_ETHTOOL_OPS(netdev, &et131x_ethtool_ops);
}
@@ -3976,7 +3977,7 @@ void et131x_set_ethtool_ops(struct net_device *netdev)
* et131x_hwaddr_init - set up the MAC Address on the ET1310
* @adapter: pointer to our private adapter structure
*/
-void et131x_hwaddr_init(struct et131x_adapter *adapter)
+static void et131x_hwaddr_init(struct et131x_adapter *adapter)
{
/* If have our default mac from init and no mac address from
* EEPROM then we need to generate the last octet and set it on the
@@ -4110,7 +4111,7 @@ static int et131x_pci_init(struct et131x_adapter *adapter,
* The routine called when the error timer expires, to track the number of
* recurring errors.
*/
-void et131x_error_timer_handler(unsigned long data)
+static void et131x_error_timer_handler(unsigned long data)
{
struct et131x_adapter *adapter = (struct et131x_adapter *) data;
struct phy_device *phydev = adapter->phydev;
@@ -4153,7 +4154,7 @@ void et131x_error_timer_handler(unsigned long data)
*
* Allocate all the memory blocks for send, receive and others.
*/
-int et131x_adapter_memory_alloc(struct et131x_adapter *adapter)
+static int et131x_adapter_memory_alloc(struct et131x_adapter *adapter)
{
int status;
@@ -4188,7 +4189,7 @@ int et131x_adapter_memory_alloc(struct et131x_adapter *adapter)
* et131x_adapter_memory_free - Free all memory allocated for use by Tx & Rx
* @adapter: pointer to our private adapter structure
*/
-void et131x_adapter_memory_free(struct et131x_adapter *adapter)
+static void et131x_adapter_memory_free(struct et131x_adapter *adapter)
{
/* Free DMA memory */
et131x_tx_dma_memory_free(adapter);
@@ -4417,7 +4418,7 @@ static void __devexit et131x_pci_remove(struct pci_dev *pdev)
* et131x_up - Bring up a device for use.
* @netdev: device to be opened
*/
-void et131x_up(struct net_device *netdev)
+static void et131x_up(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -4429,7 +4430,7 @@ void et131x_up(struct net_device *netdev)
* et131x_down - Bring down the device
* @netdev: device to be broght down
*/
-void et131x_down(struct net_device *netdev)
+static void et131x_down(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -4567,7 +4568,7 @@ out:
* scheduled to run in a deferred context by the ISR. This is where the ISR's
* work actually gets done.
*/
-void et131x_isr_handler(struct work_struct *work)
+static void et131x_isr_handler(struct work_struct *work)
{
struct et131x_adapter *adapter =
container_of(work, struct et131x_adapter, task);
@@ -4823,7 +4824,7 @@ static struct net_device_stats *et131x_stats(struct net_device *netdev)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_open(struct net_device *netdev)
+static int et131x_open(struct net_device *netdev)
{
int result = 0;
struct et131x_adapter *adapter = netdev_priv(netdev);
@@ -4857,7 +4858,7 @@ int et131x_open(struct net_device *netdev)
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_close(struct net_device *netdev)
+static int et131x_close(struct net_device *netdev)
{
struct et131x_adapter *adapter = netdev_priv(netdev);
--
1.7.6.4
^ permalink raw reply related
* Re: [RFC/PATCH 2/2] sparse: Use native sizes for data types
From: Josh Triplett @ 2011-10-23 17:13 UTC (permalink / raw)
To: Jeff Garzik
Cc: penberg, linux-sparse, Pekka Enberg, Christopher Li, Jeff Garzik,
Linus Torvalds
In-Reply-To: <4EA4385C.1050800@garzik.org>
On Sun, Oct 23, 2011 at 11:53:00AM -0400, Jeff Garzik wrote:
> On 10/23/2011 08:37 AM, penberg@cs.helsinki.fi wrote:
> >From: Pekka Enberg<penberg@kernel.org>
> >
> >This patch is needed to fix the sparsec LLVM backend data type sizes.
> >
> >Cc: Christopher Li<sparse@chrisli.org>
> >Cc: Jeff Garzik<jgarzik@redhat.com>
> >Cc: Linus Torvalds<torvalds@linux-foundation.org>
> >Signed-off-by: Pekka Enberg<penberg@kernel.org>
> >---
> > target.c | 10 +++++-----
> > 1 files changed, 5 insertions(+), 5 deletions(-)
> >
> >diff --git a/target.c b/target.c
> >index 6a535bc..009002f 100644
> >--- a/target.c
> >+++ b/target.c
> >@@ -17,9 +17,9 @@ int max_alignment = 16;
> > int bits_in_bool = 8;
> > int bits_in_char = 8;
> > int bits_in_short = 16;
> >-int bits_in_int = 32;
> >-int bits_in_long = 32;
> >-int bits_in_longlong = 64;
> >+int bits_in_int = sizeof(int) * 8;
> >+int bits_in_long = sizeof(long) * 8;
> >+int bits_in_longlong = sizeof(long long) * 8;
> > int bits_in_longlonglong = 128;
> >
> > int max_int_alignment = 4;
> >@@ -36,8 +36,8 @@ int max_fp_alignment = 8;
> > /*
> > * Pointer data type
> > */
> >-int bits_in_pointer = 32;
> >-int pointer_alignment = 4;
> >+int bits_in_pointer = sizeof(void *) * 8;
> >+int pointer_alignment = sizeof(void *);
>
> No objection, but ideally we should select from a target template.
>
> We don't want to start down the road of making runtime target
> switching (i386/x86-64) difficult.
Agreed. The platform that sparse checks code for should not necessarily
correlate with what sparse observes at compile-time about the build
platform.
- Josh Triplett
^ permalink raw reply
* [U-Boot] [RESEND PATCH v3] Add assert() for debug assertions
From: Wolfgang Denk @ 2011-10-23 17:13 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAJaTeTq_=k+1KwM3SZCoJ-zdm0_KRh9r5arp8Bbej+OJJ7BYag@mail.gmail.com>
Dear Mike Frysinger,
In message <CAJaTeTq_=k+1KwM3SZCoJ-zdm0_KRh9r5arp8Bbej+OJJ7BYag@mail.gmail.com> you wrote:
>
> > __assert_fail() only ever gets used (and thus needs to be compiled in)
> > if DEBUG is defined, right? =A0SO why cannot you wrap the code in a
> > "#ifdef DEBUG" ?
>
> people often enable DEBUG on a per file basis. so if i'm debugging
> drivers/spi/bfin_spi.c, i put "#define DEBUG" at the top of it.
Right you are. I missed that.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Landing: a controlled mid-air collision with a planet.
^ permalink raw reply
* Re: [PATCH 02/14] ARM : SAMSUNG : Add RS485 support.
From: Paul Schilling @ 2011-10-23 17:12 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Ben Dooks, Kukjin Kim, Alan Cox, Greg Kroah-Hartman, Boojin Kim,
Nicolas Pitre, linux-arm-kernel, linux-kernel, linux-serial
In-Reply-To: <20111022134726.GD21374@n2100.arm.linux.org.uk>
See Comments inline.
On Sat, Oct 22, 2011 at 8:47 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Oct 21, 2011 at 10:46:34PM -0500, Paul Schilling wrote:
>> +config SAMSUNG_HAS_RS485
>> + bool "Enable RS485 support for Samsung"
>> + depends on SERIAL_SAMSUNG && (MACH_CONDOR2440 || MACH_CONDOR2416 || MACH_MINI2440)
>> + default y if (MACH_CONDOR2440 || MACH_CONDOR2416)
>> + default n if (MACH_MINI2440)
>> +
>> +config SAMSUNG_485_LOW_RES_TIMER
>> + bool "Samsung RS-485 use low res timer during transmit"
>> + depends on SERIAL_SAMSUNG && SAMSUNG_HAS_RS485
>> + default n
>
> n is the default, so this doesn't need to be specified.
Sorry I can fix that.
>
>> +static void s3c24xx_serial_rx_fifo_enable(
>> + struct uart_port *port,
>> + unsigned int en)
>> +{
>> + unsigned long flags;
>> + unsigned int ucon;
>> + static unsigned int last_state = 1;
>> +/* FIXME */
>> + #if 0
>> + if (last_state != en) {
>> +
>> + struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> +
>> + ucon = rd_regl(port, S3C2410_UCON);
>> +
>> + ucon &= ~(S3C2440_UFCON_RXTRIG32 | S3C2410_UCON_RXILEVEL);
>> +
>> + if (en) {
>> + ucon |= cfg->ucon;
>> + }
>> +
>> + wr_regl(port, S3C2410_UCON, ucon);
>> +
>> + spin_unlock_irqrestore(&port->lock, flags);
>> + }
>> +#endif
>
> This looks like dead code.
It is broken dead code. Performance of the RS485 code could be
increased if this code could be made to work.
right now I am forced to leave it in one character per interrupt so
that each character that's received is checked
against the token. This code was supposed leave it in multi-byte FIFO
mode until the token byte is sent then switch to receiving
one byte at a time until the token is received.
>
>> + } else {
>> + /* Set a short timer to toggle RTS */
>> + mod_timer(
>> + &(ourport->rs485_tx_timer),
>> + jiffies + usecs_to_jiffies(
>> + ourport->char_time_usec
>> + / 10));
>
> This could do with being better formatted. Also, & doesn't need following
> parens.
when I ran checkpatch it complained that it exceeded 80 characters. I
had trouble keeping this line
under 80 characters.
>
>> + /* Read UART transmit status register */
>> + utrstat = rd_regl(&(ourport->port), S3C2410_UTRSTAT);
>
> Doesn't need the parens.
I can remove the extra parentheses.
>
>> +/* Callback array*/
>> +enum hrtimer_restart (*callback_list[CONFIG_SERIAL_SAMSUNG_UARTS])(struct hrtimer *) = {
>> + &rs485_hr_timer_callback_uart0,
>> + &rs485_hr_timer_callback_uart1,
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>> + &rs485_hr_timer_callback_uart2,
>> +#endif
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>> + &rs485_hr_timer_callback_uart3,
>> +#endif
>
> Silly indentation - this doesn't need two tabs.
>
>> +};
>> +
>> +#endif
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> +
>> static void s3c24xx_serial_stop_tx(struct uart_port *port)
>> {
>> struct s3c24xx_uart_port *ourport = to_ourport(port);
>>
>> if (tx_enabled(port)) {
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> + if (ourport->rs485.flags & SER_RS485_ENABLED) {
>> +#ifdef CONFIG_SAMSUNG_485_LOW_RES_TIMER
>> + /* Set a short timer to toggle RTS */
>> + mod_timer(&(ourport->rs485_tx_timer),
>
> Doesn't need parens.
>
>> + jiffies + usecs_to_jiffies(ourport->char_time_usec * s3c24xx_serial_tx_getfifocnt(ourport)));
>> +#else
>> + ktime_t kt;
>> +
>> + /* Set time struct to one char time. */
>> + kt = ktime_set(0, ourport->char_time_nanosec);
>> +
>> + /* Start the high res timer. */
>> + hrtimer_start(&(ourport->hr_rs485_tx_timer), kt, HRTIMER_MODE_REL);
>
> Doesn't need parens.
>
>> +#endif /* CONFIG_SAMSUNG_485_LOW_RES_TIMER */
>> +
>> + s3c24xx_serial_rx_fifo_enable(port, 0);
>> +
>> + }
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> disable_irq_nosync(ourport->tx_irq);
>> tx_enabled(port) = 0;
>> - if (port->flags & UPF_CONS_FLOW)
>> + if (port->flags & UPF_CONS_FLOW) {
>> s3c24xx_serial_rx_enable(port);
>> + }
>
> Why are you reformatting code?
I will remove the reformatting of the code.
>
>> @@ -785,7 +1177,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
>> port->ignore_status_mask = 0;
>> if (termios->c_iflag & IGNPAR)
>> port->ignore_status_mask |= S3C2410_UERSTAT_OVERRUN;
>> - if (termios->c_iflag & IGNBRK && termios->c_iflag & IGNPAR)
>> + if ((termios->c_iflag & IGNBRK) && (termios->c_iflag & IGNPAR))
>
> More code reformatting.
>
>> @@ -830,7 +1228,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags)
>> {
>> struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
>>
>> - if (flags & UART_CONFIG_TYPE &&
>> + if ((flags & UART_CONFIG_TYPE) &&
>
> And some more.
>
>> +#if 0
>> + dev_info(port., "rts: on send = %i, after = %i, enabled = %i",
>
> That can't be correct - and as its #if 0'd out, either remove this or
> fix it to be correct (and use dev_dbg if you want it to be debugging.)
>
>> +static ssize_t s3c24xx_serial_set_485_mode(struct device *dev,
>> + struct device_attribute *attr,
>> + const char *buf, size_t count)
>> +
>> +{
>> + struct uart_port *port = s3c24xx_dev_to_port(dev);
>> + struct s3c24xx_uart_port *ourport = to_ourport(port);
>> +
>> + if (!strncmp(buf, "Enabled", 7)) {
>> + ourport->rs485.flags |= SER_RS485_ENABLED;
>> + } else if (!strncmp(buf, "Disabled", 8)) {
>
> Do you really require the first character to be capitalized?
>
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> +
>> + ret = device_create_file(&dev->dev, &dev_attr_485_status);
>> + if (ret < 0)
>> + printk(KERN_ERR "%s: failed to add 485 status attr.\n", __func__);
>
> pr_err() ? dev_err() ?
>
^ permalink raw reply
* Re: [PATCH 02/14] ARM : SAMSUNG : Add RS485 support.
From: Paul Schilling @ 2011-10-23 17:12 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Ben Dooks, Kukjin Kim, Alan Cox, Greg Kroah-Hartman, Boojin Kim,
Nicolas Pitre, linux-arm-kernel, linux-kernel, linux-serial
In-Reply-To: <20111022134726.GD21374@n2100.arm.linux.org.uk>
See Comments inline.
On Sat, Oct 22, 2011 at 8:47 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Oct 21, 2011 at 10:46:34PM -0500, Paul Schilling wrote:
>> +config SAMSUNG_HAS_RS485
>> + bool "Enable RS485 support for Samsung"
>> + depends on SERIAL_SAMSUNG && (MACH_CONDOR2440 || MACH_CONDOR2416 || MACH_MINI2440)
>> + default y if (MACH_CONDOR2440 || MACH_CONDOR2416)
>> + default n if (MACH_MINI2440)
>> +
>> +config SAMSUNG_485_LOW_RES_TIMER
>> + bool "Samsung RS-485 use low res timer during transmit"
>> + depends on SERIAL_SAMSUNG && SAMSUNG_HAS_RS485
>> + default n
>
> n is the default, so this doesn't need to be specified.
Sorry I can fix that.
>
>> +static void s3c24xx_serial_rx_fifo_enable(
>> + struct uart_port *port,
>> + unsigned int en)
>> +{
>> + unsigned long flags;
>> + unsigned int ucon;
>> + static unsigned int last_state = 1;
>> +/* FIXME */
>> + #if 0
>> + if (last_state != en) {
>> +
>> + struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
>> +
>> + spin_lock_irqsave(&port->lock, flags);
>> +
>> + ucon = rd_regl(port, S3C2410_UCON);
>> +
>> + ucon &= ~(S3C2440_UFCON_RXTRIG32 | S3C2410_UCON_RXILEVEL);
>> +
>> + if (en) {
>> + ucon |= cfg->ucon;
>> + }
>> +
>> + wr_regl(port, S3C2410_UCON, ucon);
>> +
>> + spin_unlock_irqrestore(&port->lock, flags);
>> + }
>> +#endif
>
> This looks like dead code.
It is broken dead code. Performance of the RS485 code could be
increased if this code could be made to work.
right now I am forced to leave it in one character per interrupt so
that each character that's received is checked
against the token. This code was supposed leave it in multi-byte FIFO
mode until the token byte is sent then switch to receiving
one byte at a time until the token is received.
>
>> + } else {
>> + /* Set a short timer to toggle RTS */
>> + mod_timer(
>> + &(ourport->rs485_tx_timer),
>> + jiffies + usecs_to_jiffies(
>> + ourport->char_time_usec
>> + / 10));
>
> This could do with being better formatted. Also, & doesn't need following
> parens.
when I ran checkpatch it complained that it exceeded 80 characters. I
had trouble keeping this line
under 80 characters.
>
>> + /* Read UART transmit status register */
>> + utrstat = rd_regl(&(ourport->port), S3C2410_UTRSTAT);
>
> Doesn't need the parens.
I can remove the extra parentheses.
>
>> +/* Callback array*/
>> +enum hrtimer_restart (*callback_list[CONFIG_SERIAL_SAMSUNG_UARTS])(struct hrtimer *) = {
>> + &rs485_hr_timer_callback_uart0,
>> + &rs485_hr_timer_callback_uart1,
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>> + &rs485_hr_timer_callback_uart2,
>> +#endif
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>> + &rs485_hr_timer_callback_uart3,
>> +#endif
>
> Silly indentation - this doesn't need two tabs.
>
>> +};
>> +
>> +#endif
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> +
>> static void s3c24xx_serial_stop_tx(struct uart_port *port)
>> {
>> struct s3c24xx_uart_port *ourport = to_ourport(port);
>>
>> if (tx_enabled(port)) {
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> + if (ourport->rs485.flags & SER_RS485_ENABLED) {
>> +#ifdef CONFIG_SAMSUNG_485_LOW_RES_TIMER
>> + /* Set a short timer to toggle RTS */
>> + mod_timer(&(ourport->rs485_tx_timer),
>
> Doesn't need parens.
>
>> + jiffies + usecs_to_jiffies(ourport->char_time_usec * s3c24xx_serial_tx_getfifocnt(ourport)));
>> +#else
>> + ktime_t kt;
>> +
>> + /* Set time struct to one char time. */
>> + kt = ktime_set(0, ourport->char_time_nanosec);
>> +
>> + /* Start the high res timer. */
>> + hrtimer_start(&(ourport->hr_rs485_tx_timer), kt, HRTIMER_MODE_REL);
>
> Doesn't need parens.
>
>> +#endif /* CONFIG_SAMSUNG_485_LOW_RES_TIMER */
>> +
>> + s3c24xx_serial_rx_fifo_enable(port, 0);
>> +
>> + }
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> disable_irq_nosync(ourport->tx_irq);
>> tx_enabled(port) = 0;
>> - if (port->flags & UPF_CONS_FLOW)
>> + if (port->flags & UPF_CONS_FLOW) {
>> s3c24xx_serial_rx_enable(port);
>> + }
>
> Why are you reformatting code?
I will remove the reformatting of the code.
>
>> @@ -785,7 +1177,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
>> port->ignore_status_mask = 0;
>> if (termios->c_iflag & IGNPAR)
>> port->ignore_status_mask |= S3C2410_UERSTAT_OVERRUN;
>> - if (termios->c_iflag & IGNBRK && termios->c_iflag & IGNPAR)
>> + if ((termios->c_iflag & IGNBRK) && (termios->c_iflag & IGNPAR))
>
> More code reformatting.
>
>> @@ -830,7 +1228,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags)
>> {
>> struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
>>
>> - if (flags & UART_CONFIG_TYPE &&
>> + if ((flags & UART_CONFIG_TYPE) &&
>
> And some more.
>
>> +#if 0
>> + dev_info(port., "rts: on send = %i, after = %i, enabled = %i",
>
> That can't be correct - and as its #if 0'd out, either remove this or
> fix it to be correct (and use dev_dbg if you want it to be debugging.)
>
>> +static ssize_t s3c24xx_serial_set_485_mode(struct device *dev,
>> + struct device_attribute *attr,
>> + const char *buf, size_t count)
>> +
>> +{
>> + struct uart_port *port = s3c24xx_dev_to_port(dev);
>> + struct s3c24xx_uart_port *ourport = to_ourport(port);
>> +
>> + if (!strncmp(buf, "Enabled", 7)) {
>> + ourport->rs485.flags |= SER_RS485_ENABLED;
>> + } else if (!strncmp(buf, "Disabled", 8)) {
>
> Do you really require the first character to be capitalized?
>
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> +
>> + ret = device_create_file(&dev->dev, &dev_attr_485_status);
>> + if (ret < 0)
>> + printk(KERN_ERR "%s: failed to add 485 status attr.\n", __func__);
>
> pr_err() ? dev_err() ?
>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 02/14] ARM : SAMSUNG : Add RS485 support.
From: Paul Schilling @ 2011-10-23 17:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111022134726.GD21374@n2100.arm.linux.org.uk>
See Comments inline.
On Sat, Oct 22, 2011 at 8:47 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Fri, Oct 21, 2011 at 10:46:34PM -0500, Paul Schilling wrote:
>> +config SAMSUNG_HAS_RS485
>> + ? ? bool "Enable RS485 support for Samsung"
>> + ? ? depends on SERIAL_SAMSUNG && (MACH_CONDOR2440 || MACH_CONDOR2416 || MACH_MINI2440)
>> + ? ? default y if (MACH_CONDOR2440 || MACH_CONDOR2416)
>> + ? ? default n if (MACH_MINI2440)
>> +
>> +config SAMSUNG_485_LOW_RES_TIMER
>> + ? ?bool "Samsung RS-485 use low res timer during transmit"
>> + ? ?depends on SERIAL_SAMSUNG && SAMSUNG_HAS_RS485
>> + ? ?default n
>
> n is the default, so this doesn't need to be specified.
Sorry I can fix that.
>
>> +static void s3c24xx_serial_rx_fifo_enable(
>> + ? ? ? ? ? ? struct uart_port *port,
>> + ? ? ? ? ? ? unsigned int en)
>> +{
>> + ? ? unsigned long flags;
>> + ? ? unsigned int ucon;
>> + ? ? static unsigned int last_state = 1;
>> +/* FIXME */
>> + ? ? #if 0
>> + ? ? if (last_state != en) {
>> +
>> + ? ? ? ? ? ? struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
>> +
>> + ? ? ? ? ? ? spin_lock_irqsave(&port->lock, flags);
>> +
>> + ? ? ? ? ? ? ucon = rd_regl(port, S3C2410_UCON);
>> +
>> + ? ? ? ? ? ? ucon &= ~(S3C2440_UFCON_RXTRIG32 | S3C2410_UCON_RXILEVEL);
>> +
>> + ? ? ? ? ? ? if (en) {
>> + ? ? ? ? ? ? ? ? ? ? ucon |= cfg->ucon;
>> + ? ? ? ? ? ? }
>> +
>> + ? ? ? ? ? ? wr_regl(port, S3C2410_UCON, ucon);
>> +
>> + ? ? ? ? ? ? spin_unlock_irqrestore(&port->lock, flags);
>> + ? ? }
>> +#endif
>
> This looks like dead code.
It is broken dead code. Performance of the RS485 code could be
increased if this code could be made to work.
right now I am forced to leave it in one character per interrupt so
that each character that's received is checked
against the token. This code was supposed leave it in multi-byte FIFO
mode until the token byte is sent then switch to receiving
one byte at a time until the token is received.
>
>> + ? ? ? ? ? ? } else {
>> + ? ? ? ? ? ? ? ? ? ? /* Set a short timer to toggle RTS */
>> + ? ? ? ? ? ? ? ? ? ? mod_timer(
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? &(ourport->rs485_tx_timer),
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? jiffies + usecs_to_jiffies(
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ourport->char_time_usec
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? / 10));
>
> This could do with being better formatted. ?Also, & doesn't need following
> parens.
when I ran checkpatch it complained that it exceeded 80 characters. I
had trouble keeping this line
under 80 characters.
>
>> + ? ? /* Read UART transmit status register */
>> + ? ? utrstat = rd_regl(&(ourport->port), S3C2410_UTRSTAT);
>
> Doesn't need the parens.
I can remove the extra parentheses.
>
>> +/* Callback array*/
>> +enum hrtimer_restart (*callback_list[CONFIG_SERIAL_SAMSUNG_UARTS])(struct hrtimer *) = {
>> + ? ? ? ? ? ? &rs485_hr_timer_callback_uart0,
>> + ? ? ? ? ? ? &rs485_hr_timer_callback_uart1,
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 2
>> + ? ? ? ? ? ? &rs485_hr_timer_callback_uart2,
>> +#endif
>> +
>> +#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
>> + ? ? ? ? ? ? &rs485_hr_timer_callback_uart3,
>> +#endif
>
> Silly indentation - this doesn't need two tabs.
>
>> +};
>> +
>> +#endif
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> +
>> ?static void s3c24xx_serial_stop_tx(struct uart_port *port)
>> ?{
>> ? ? ? struct s3c24xx_uart_port *ourport = to_ourport(port);
>>
>> ? ? ? if (tx_enabled(port)) {
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> + ? ? ? ? ? ? if (ourport->rs485.flags & SER_RS485_ENABLED) {
>> +#ifdef CONFIG_SAMSUNG_485_LOW_RES_TIMER
>> + ? ? ? ? ? ? ? ? ? ? /* Set a short timer to toggle RTS */
>> + ? ? ? ? ? ? ? ? ? ? mod_timer(&(ourport->rs485_tx_timer),
>
> Doesn't need parens.
>
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? jiffies + usecs_to_jiffies(ourport->char_time_usec * s3c24xx_serial_tx_getfifocnt(ourport)));
>> +#else
>> + ? ? ? ? ? ? ? ? ? ? ktime_t kt;
>> +
>> + ? ? ? ? ? ? ? ? ? ? /* Set time struct to one char time. */
>> + ? ? ? ? ? ? ? ? ? ? kt = ktime_set(0, ourport->char_time_nanosec);
>> +
>> + ? ? ? ? ? ? ? ? ? ? /* Start the high res timer. */
>> + ? ? ? ? ? ? ? ? ? ? hrtimer_start(&(ourport->hr_rs485_tx_timer), kt, HRTIMER_MODE_REL);
>
> Doesn't need parens.
>
>> +#endif /* CONFIG_SAMSUNG_485_LOW_RES_TIMER */
>> +
>> + ? ? ? ? ? ? ? ? ? ? s3c24xx_serial_rx_fifo_enable(port, 0);
>> +
>> + ? ? ? ? ? ? }
>> +#endif /* CONFIG_SAMSUNG_HAS_RS485 */
>> +
>> ? ? ? ? ? ? ? disable_irq_nosync(ourport->tx_irq);
>> ? ? ? ? ? ? ? tx_enabled(port) = 0;
>> - ? ? ? ? ? ? if (port->flags & UPF_CONS_FLOW)
>> + ? ? ? ? ? ? if (port->flags & UPF_CONS_FLOW) {
>> ? ? ? ? ? ? ? ? ? ? ? s3c24xx_serial_rx_enable(port);
>> + ? ? ? ? ? ? }
>
> Why are you reformatting code?
I will remove the reformatting of the code.
>
>> @@ -785,7 +1177,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port,
>> ? ? ? port->ignore_status_mask = 0;
>> ? ? ? if (termios->c_iflag & IGNPAR)
>> ? ? ? ? ? ? ? port->ignore_status_mask |= S3C2410_UERSTAT_OVERRUN;
>> - ? ? if (termios->c_iflag & IGNBRK && termios->c_iflag & IGNPAR)
>> + ? ? if ((termios->c_iflag & IGNBRK) && (termios->c_iflag & IGNPAR))
>
> More code reformatting.
>
>> @@ -830,7 +1228,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags)
>> ?{
>> ? ? ? struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port);
>>
>> - ? ? if (flags & UART_CONFIG_TYPE &&
>> + ? ? if ((flags & UART_CONFIG_TYPE) &&
>
> And some more.
>
>> +#if 0
>> + ? ? dev_info(port., "rts: on send = %i, after = %i, enabled = %i",
>
> That can't be correct - and as its #if 0'd out, either remove this or
> fix it to be correct (and use dev_dbg if you want it to be debugging.)
>
>> +static ssize_t s3c24xx_serial_set_485_mode(struct device *dev,
>> + ? ? ? ? ? ? struct device_attribute *attr,
>> + ? ? ? ? ? ? const char *buf, size_t count)
>> +
>> +{
>> + ? ? struct uart_port *port = s3c24xx_dev_to_port(dev);
>> + ? ? struct s3c24xx_uart_port *ourport = to_ourport(port);
>> +
>> + ? ? if (!strncmp(buf, "Enabled", 7)) {
>> + ? ? ? ? ? ? ourport->rs485.flags |= SER_RS485_ENABLED;
>> + ? ? } else if (!strncmp(buf, "Disabled", 8)) {
>
> Do you really require the first character to be capitalized?
>
>> +#ifdef CONFIG_SAMSUNG_HAS_RS485
>> +
>> + ? ? ret = device_create_file(&dev->dev, &dev_attr_485_status);
>> + ? ? if (ret < 0)
>> + ? ? ? ? ? ? printk(KERN_ERR "%s: failed to add 485 status attr.\n", __func__);
>
> pr_err() ? ?dev_err() ?
>
^ permalink raw reply
* [U-Boot] [PATCH 01/39] DEBUG: Fix debug macros
From: Wolfgang Denk @ 2011-10-23 17:12 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAJaTeTpwpO6Kd-q=bmbzqPJMoNz_YiOWGRks=zGkhes0vUA=mg@mail.gmail.com>
Dear Mike Frysinger,
In message <CAJaTeTpwpO6Kd-q=bmbzqPJMoNz_YiOWGRks=zGkhes0vUA=mg@mail.gmail.com> you wrote:
>
> > +#define debugX(level, fmt, args...) \
> > + debug_cond((_DEBUG && DEBUG >=3D (level)), fmt, ##args)
>
> i thought we were just going to punt debugX() ?
Yes, please do!
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I have never understood the female capacity to avoid a direct answer
to any question.
-- Spock, "This Side of Paradise", stardate 3417.3
^ permalink raw reply
* [U-Boot] [RESEND PATCH v3] Add assert() for debug assertions
From: Wolfgang Denk @ 2011-10-23 17:11 UTC (permalink / raw)
To: u-boot
In-Reply-To: <CAJaTeTrUJH+p1jTU88d5KDv4EU57DiU+=_ibp9DZHXU78U1HdQ@mail.gmail.com>
Dear Mike Frysinger,
In message <CAJaTeTrUJH+p1jTU88d5KDv4EU57DiU+=_ibp9DZHXU78U1HdQ@mail.gmail.com> you wrote:
>
> >> +void __assert_fail(const char *assertion, const char *file, unsigned line,
> >> + const char *function)
> >> +{
> >> + /* This will not return */
> >> + panic("%s:%u: %s: Assertion `%s' failed.", file, line, function,
> >> + assertion);
> >> +}
> >
> > Can you please #ifdef it so it doesn't get added for the non-debug
> > case, too?
>
> most arches are building with --gc-sections now which means there is
> no overhead added for them. should we look at fixing the few holdouts
> rather than adding #ifdefs ?
I think Power does use --gc-sections, still I see code size growing.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
All your people must learn before you can reach for the stars.
-- Kirk, "The Gamesters of Triskelion", stardate 3259.2
^ permalink raw reply
* [PATCH] perf: do not set task_ctx pointer in cpuctx if there is no events in the context
From: Gleb Natapov @ 2011-10-23 17:10 UTC (permalink / raw)
To: linux-kernel
Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar,
Arnaldo Carvalho de Melo
Do not set task_ctx pointer during sched_in if there is no
events associated with the context. Otherwise if during task
execution total number of events in the system will become zero
perf_event_context_sched_out() will not be called and cpuctx->task_ctx
will be left with a stale value.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0f85778..68b13ee 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2172,7 +2172,8 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx,
perf_event_sched_in(cpuctx, ctx, task);
- cpuctx->task_ctx = ctx;
+ if (ctx->nr_events)
+ cpuctx->task_ctx = ctx;
perf_pmu_enable(ctx->pmu);
perf_ctx_unlock(cpuctx, ctx);
--
Gleb.
^ permalink raw reply related
* Re: [PATCH] x86: Fix compilation bug in kprobes' twobyte_is_boostable
From: Josh Stone @ 2011-10-23 17:07 UTC (permalink / raw)
To: Linus Torvalds
Cc: linux-kernel, Masami Hiramatsu, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, Srikar Dronamraju, Jakub Jelinek
In-Reply-To: <CA+55aFzXHLrcP1idskKJXcxdPfjSCfgmtYzd7r4uA4ni1E+k+A@mail.gmail.com>
On 10/22/2011 05:25 PM, Linus Torvalds wrote:
> Hmm. I'd *much* rather do this in arch/x86/include/asm/bitops.h
> instead, methinks.
Agreed, that's why I tried that first.
> Also, rather than your
>
>> See also my more general fix, https://lkml.org/lkml/2011/10/6/412
>
> wouldn't the simple fix be just to add the volatile there to the cast
> we already do, ie something like the appended (cut-and-paste, so it's
> whitespace-damaged, but you get the idea).
Unfortunately, no. Whatever const-propagation gcc is doing here
(somewhat wrongly per PR50571) is not affected by volatile on that cast.
I also tried leaving it to the parameter type (no cast), no help.
Another historical note is that the parameter used to be void* until
commit 5136dea5, which I suppose is why the current cast exists at all.
Reverting that still doesn't affect the immediate problem.
It may have gotten lost in the various messages I sent, but note that
this is only happening on i386, where the source u32 matches the size of
the casted long. On x86_64, where long is of course bigger than u32,
the pointer aliasing seems to prevent the issue. So yet another fix is
to make that asm cast something silly that will always alias, like
(*(char*)addr). That might be even more magical/fragile though.
> And I don't mind volatile in code nearly as much as I mind volatile on
> the data structures (it's one of my "C typing was misdesigned" pet
> peeves: I think "volatile" is about the access, not about the data)
I just tried removing the const from twobyte_is_boostable[], and that
also does the trick. Not sure why I didn't try that first -- I guess
because I saw all the volatiles in bitops. Is that more palatable, or
would you still rather try to fix it in bitops.h directly?
> - Long long ago, we had that "big array" approach for ADDR too. So
> we've wavered between the volatile and using a block memory op. But
> we've used the "volatile" for a long time now for the bit change ones,
> so I don't think we should mix concepts like your patch.
Do you recall why it settled on volatile? That seems like the less
descriptive of the two approaches. But "long long ago" appears to be
beyond recorded (git) history...
Thanks,
Josh
^ permalink raw reply
* RE: perf tools: interface for improved PEBS ABI can accept wrong parameter
From: Xu, Anhua @ 2011-10-23 17:07 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Peter Zijlstra, Ingo Molnar, linux-kernel@vger.kernel.org
In-Reply-To: <20111019141506.GA8132@ghostprotocols.net>
I have update my patch. Hope it is not so horrid :)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c816075..837f416 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -238,6 +238,17 @@ struct perf_event_attr {
};
};
+enum perf_sample_ip_constraints {
+ PERF_SAMPLE_IP_ARBITRARY_SKID,
+ PERF_SAMPLE_IP_CONSTANT_SKID,
+ PERF_SAMPLE_IP_REQUEST_NOSKID,
+
+ /*
+ * The PEBS implementation now supports up to 2.
+ */
+ PERF_SMAPLE_IP_CONSTRAINT_MAX,
+};
+
/*
* Ioctls that can be done on a perf event fd:
*/
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 928918b..55567ec 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -775,7 +775,10 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr)
attr->exclude_user = eu;
attr->exclude_kernel = ek;
attr->exclude_hv = eh;
- attr->precise_ip = precise;
+ if ( precise < PERF_SMAPLE_IP_CONSTRAINT_MAX )
+ attr->precise_ip = precise;
+ else
+ return -EOPNOTSUPP;
return 0;
}
-----Original Message-----
From: Arnaldo Carvalho de Melo [mailto:acme@redhat.com]
Sent: Wednesday, October 19, 2011 10:15 PM
To: Xu, Anhua
Cc: Peter Zijlstra; Ingo Molnar; linux-kernel@vger.kernel.org
Subject: Re: perf tools: interface for improved PEBS ABI can accept wrong parameter
Em Wed, Oct 19, 2011 at 10:23:12AM +0800, Xu, Anhua escreveu:
> Thanks Peter:). The key point for this is that the detailed information about "PRECISE_IP" may not be exposed to user space.
> Error reporting may come from syscall. Anyway, expect acme's suggestions.
Well, at least we can do as you did and avoid requests completely
invalid per the ABI or look the other way, truncate and silently provide
different behaviour than requested.
Point is how to propagate back from parse_event_modifier so that we
provide a sensible error message.
One could try to reuse errno and find things like -EINVAL, ELEVEL or
define some enum.
>
> -----Original Message-----
> From: Peter Zijlstra [mailto:a.p.zijlstra@chello.nl]
> Sent: Wednesday, October 19, 2011 2:28 AM
> To: Ingo Molnar
> Cc: Xu, Anhua; Arnaldo Carvalho de Melo; linux-kernel@vger.kernel.org
> Subject: Re: perf tools: interface for improved PEBS ABI can accept wrong parameter
>
> On Tue, 2011-10-18 at 20:19 +0200, Ingo Molnar wrote:
> > > +#define SAMPLE_IP_MAX 3
> > > precise_ip : 2, /* skid constraint */
> > > mmap_data : 1, /* non-exec mmap data */
> > > sample_id_all : 1, /* sample_type all events */
> > > diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
> > > index 928918b..a2068cc 100644
> > > --- a/tools/perf/util/parse-events.c
> > > +++ b/tools/perf/util/parse-events.c
> > > @@ -775,7 +775,10 @@ parse_event_modifier(const char **strp, struct perf_event_attr *attr)
> > > attr->exclude_user = eu;
> > > attr->exclude_kernel = ek;
> > > attr->exclude_hv = eh;
> > > - attr->precise_ip = precise;
> > > + if ( precise < SAMPLE_IP_MAX )
> > > + attr->precise_ip = precise;
> > > + else
> > > + return -1;
>
> That name is horrid, how about PRECISE_IP_MAX? Also, I suspect acme will
> want a better error return than -1, but I'll leave that up to him.
^ permalink raw reply related
* Is there a tool which can generate a small and simple source tree after config?
From: Aiolia Lea @ 2011-10-23 17:05 UTC (permalink / raw)
To: kernelnewbies
In-Reply-To: <201110240029342341569@gmail.com>
hum, how about doxygen?
On Sun, Oct 23, 2011 at 6:29 PM, jiangtao.jit <jiangtao.jit@gmail.com>wrote:
> Hi:
>
> While reading the kernel code
> 1. the huge amount of files make me scared
> there are too many alike functions in different files
> sometimes I can't figure out which one was really compiled
> 2. too many macros in the definition of a struct or functions declaration
> confused me a lot
> I tried to follow the generated file autoconf.h to guess the final face
> but it's really a difficult thing
>
> Is there a tool which can generate a small and simple source tree after
> config?
> not pre-processor
> just generate a small source tree contains the files and dirs which really
> will be compiled
> and no macros like CONFIG_SMP etc.
> according to the configuration
>
> or some other way to understand the architecture of the final working
> source tree?
>
> Thanks.
>
> --
> 2011-10-23
> jiangtao.jit
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Best Regards!
Aiolia Lea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111023/71772272/attachment.html
^ permalink raw reply
* [ath9k-devel] Can't associate with a particular AP
From: Peter Stuge @ 2011-10-23 16:52 UTC (permalink / raw)
To: ath9k-devel
In-Reply-To: <20111023163427.GB5424@kirya.net>
Julien Valroff wrote:
> > I think it is important to iwconfig eth1 mode monitor before you run
> > ip link set dev eth1 up, and once you have done that it does not
> > matter what settings wireshark does or does not do, the mode can't be
> > changed when the interface is up, so just starting the capture should
> > work.
>
> I couldn't capture anything this way from the other laptops.
How does it fail?
> > > Cell 01 - Address: BA:F4:8A:C6:C8:44
> > ..
> > > Cell 04 - Address: C6:6E:27:A6:BE:A4
> >
> > Which is the actual correct address of your AP? I would expect
> > c6-6e-27, but the IEEE OUI listing does not have a match for it!
>
> I would also say that, given what I can see from the other laptops.
I would check the sticker on the AP.
> > > How is this possible?
> >
> > I guess some fundamental data corruption problem in ath9k. I'm not
> > surprised at all, although developers claim that by now the code
> > quality is good. This is a total BS error. I could rant for forever.
>
> Are you sure it could not be a problem with the AP?
If ath9k can associate sometimes it really must be able to associate
every time, especially since other drivers can.
> Or an incompatibility between both,
This would of course be unacceptable, since ath9k is supposed to
implement a standard, the purpose of which is interoperability.
> as I have no problem with the same AP with other
> laptops/smartphones.
The other laptops likely have different hardware and software. If you
want you can gather more data by comparing results while you
eliminate those differences one at a time.
> > I would try FreeBSD on that machine. I believe the driver there is
> > more reliable, and using it can allow you to get more concrete help
> > from Adrian in case the problem is seen also there.
>
> I will try something like a livecd,
Might work, but by doing that you are only adding more parameters,
which is absolutely counter-productive for debugging.
> I do not want to install FreeBSD.
This is stupid. Either you want to resolve the problem or you do not.
If you do not then you would not have posted to the list. If
installing FreeBSD can help identify the problem then that is
obviously what you should do.
> Or it could be a good opportunity to test Debian GNU/kFreeBSD ;)
Again a really bad idea. The purpose of using FreeBSD would be to
get another data point, and to take advantage of Adrian's expertise.
The only way of doing that which makes sense is to use exactly the
same code that Adrian has; which means you should build the very
latest fbsd world and kernel, and see what happens. This should be
really easy given that you have experience from distribution
development already. Also, this should be absolutely obvious to you
already. I'm surprised I have to explain it.
It's simple: Either you want to try to identify the problem, or you
don't care so much. If you don't care then you can't expect anyone
else to, and the problem will stay unresolved. You have an
opportunity to improve ath9k for the benefit of all, and you do not
want to do it because you would have to install FreeBSD? lolwut?
//Peter
^ permalink raw reply
* Re: [PATCH v2 3/7] clk: Add fixed-rate clock
From: Turquette, Mike @ 2011-10-23 16:51 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-kernel, linux-arm-kernel, jeremy.kerr, broonie, tglx,
linus.walleij, amit.kucheria, dsaxena, patches, linaro-dev, paul,
grant.likely, sboyd, skannan, magnus.damm, arnd.bergmann, linux,
eric.miao, richard.zhao
In-Reply-To: <20111023143057.GF1401@S2100-06.ap.freescale.net>
On Sun, Oct 23, 2011 at 7:30 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Thu, Sep 22, 2011 at 03:26:58PM -0700, Mike Turquette wrote:
>> From: Jeremy Kerr <jeremy.kerr@canonical.com>
>> +/* Base clock implementations. Platform clock implementations can use these
>> + * directly, or 'subclass' as approprate */
>> +
> /*
> * Multiple lines comments
> */
Thanks for the review Shawn. Will roll into V3 patchset.
Regards,
Mike
> Regards,
> Shawn
^ permalink raw reply
* [PATCH v2 3/7] clk: Add fixed-rate clock
From: Turquette, Mike @ 2011-10-23 16:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111023143057.GF1401@S2100-06.ap.freescale.net>
On Sun, Oct 23, 2011 at 7:30 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Thu, Sep 22, 2011 at 03:26:58PM -0700, Mike Turquette wrote:
>> From: Jeremy Kerr <jeremy.kerr@canonical.com>
>> +/* Base clock implementations. Platform clock implementations can use these
>> + * directly, or 'subclass' as approprate */
>> +
> /*
> ?* Multiple lines comments
> ?*/
Thanks for the review Shawn. Will roll into V3 patchset.
Regards,
Mike
> Regards,
> Shawn
^ permalink raw reply
* Re: [PATCH v2 2/7] clk: Implement clk_set_rate
From: Turquette, Mike @ 2011-10-23 16:50 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-kernel, linux-arm-kernel, jeremy.kerr, broonie, tglx,
linus.walleij, amit.kucheria, dsaxena, patches, linaro-dev, paul,
grant.likely, sboyd, skannan, magnus.damm, arnd.bergmann, linux,
eric.miao, richard.zhao
In-Reply-To: <20111023142458.GE1401@S2100-06.ap.freescale.net>
On Sun, Oct 23, 2011 at 7:24 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Thu, Sep 22, 2011 at 03:26:57PM -0700, Mike Turquette wrote:
>> From: Jeremy Kerr <jeremy.kerr@canonical.com>
> [...]
>
>> + * @set_rate Change the rate of this clock. If this callback returns
>> + * CLK_SET_RATE_PROPAGATE, the rate change will be propagated to
>
> s/CLK_SET_RATE_PROPAGATE/CLK_PARENT_RATE_CHANGE, as suggested by your
> change log above?
Thanks for reviewing. Will roll into V3 patchset.
Regards,
Mike
>
>> + * the parent clock (which may propagate again). The requested
>> + * rate of the parent is passed back from the callback in the
>> + * second 'unsigned long *' argument.
>> + *
>
> --
> Regards,
> Shawn
>
>
^ permalink raw reply
* [PATCH v2 2/7] clk: Implement clk_set_rate
From: Turquette, Mike @ 2011-10-23 16:50 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20111023142458.GE1401@S2100-06.ap.freescale.net>
On Sun, Oct 23, 2011 at 7:24 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> On Thu, Sep 22, 2011 at 03:26:57PM -0700, Mike Turquette wrote:
>> From: Jeremy Kerr <jeremy.kerr@canonical.com>
> [...]
>
>> + * @set_rate Change the rate of this clock. If this callback returns
>> + * ? ? ? ? ? CLK_SET_RATE_PROPAGATE, the rate change will be propagated to
>
> s/CLK_SET_RATE_PROPAGATE/CLK_PARENT_RATE_CHANGE, as suggested by your
> change log above?
Thanks for reviewing. Will roll into V3 patchset.
Regards,
Mike
>
>> + * ? ? ? ? ? the parent clock (which may propagate again). The requested
>> + * ? ? ? ? ? rate of the parent is passed back from the callback in the
>> + * ? ? ? ? ? second 'unsigned long *' argument.
>> + *
>
> --
> Regards,
> Shawn
>
>
^ permalink raw reply
* [PATCH] ipv6: Do not use routes from locally generated RAs
From: Andreas Hofmeister @ 2011-10-23 16:41 UTC (permalink / raw)
To: netdev
When hybrid mode is enabled (accept_ra == 2), the kernel also sees RAs
generated locally. This is useful since it allows the kernel to auto-configure
its own interface addresses.
However, if 'accept_ra_defrtr' and/or 'accept_ra_rtr_pref' are set and the
locally generated RAs announce the default route and/or other route information,
the kernel happily inserts bogus routes with its own address as gateway.
With this patch, adding routes from an RA will be skiped when the RAs source
address matches any local address, just as if 'accept_ra_defrtr' and
'accept_ra_rtr_pref' were set to 0.
---
net/ipv6/ndisc.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 67501b6..00fa46e1 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1226,6 +1226,9 @@ static void ndisc_router_discovery(struct sk_buff *skb)
if (!in6_dev->cnf.accept_ra_defrtr)
goto skip_defrtr;
+ if (ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, NULL, 0))
+ goto skip_defrtr;
+
lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime);
#ifdef CONFIG_IPV6_ROUTER_PREF
@@ -1350,6 +1353,9 @@ skip_linkparms:
goto out;
#ifdef CONFIG_IPV6_ROUTE_INFO
+ if (ipv6_chk_addr(dev_net(in6_dev->dev), &ipv6_hdr(skb)->saddr, NULL, 0))
+ goto skip_routeinfo;
+
if (in6_dev->cnf.accept_ra_rtr_pref && ndopts.nd_opts_ri) {
struct nd_opt_hdr *p;
for (p = ndopts.nd_opts_ri;
@@ -1367,6 +1373,8 @@ skip_linkparms:
&ipv6_hdr(skb)->saddr);
}
}
+
+skip_routeinfo:
#endif
#ifdef CONFIG_IPV6_NDISC_NODETYPE
--
1.7.6.1
^ permalink raw reply related
* Re: [PATCH v2 1/7] clk: Add a generic clock infrastructure
From: Turquette, Mike @ 2011-10-23 16:49 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-kernel, linux-arm-kernel, jeremy.kerr, broonie, tglx,
linus.walleij, amit.kucheria, dsaxena, patches, linaro-dev, paul,
grant.likely, sboyd, skannan, magnus.damm, arnd.bergmann, linux,
eric.miao, richard.zhao
In-Reply-To: <20111023125555.GD1401@S2100-06.ap.freescale.net>
On Sun, Oct 23, 2011 at 5:55 AM, Shawn Guo <shawn.guo@freescale.com> wrote:
> Hi Mike,
>
> Some random comments/nits ...
Thanks for reviewing Shawn. Will roll changes into V3.
Regards,
Mike
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.