Re: Build regressions/improvements in v3.16-rc3

2014-07-01 Thread Geert Uytterhoeven
On Tue, Jul 1, 2014 at 9:58 AM, Geert Uytterhoeven  wrote:
> JFYI, when comparing v3.16-rc3[1]  to v3.16-rc2[3], the summaries are:
>   - build errors: +5/-63

  + /scratch/kisskb/src/kernel/bounds.c: error: -mcall-aixdesc must be
big endian:  => 1:0
  + /scratch/kisskb/src/scripts/mod/devicetable-offsets.c: error:
-mcall-aixdesc must be big endianmake[3]: :  => 1:0
  + /scratch/kisskb/src/scripts/mod/empty.c: error: -mcall-aixdesc
must be big endian:  => 1:0
  + : error: -mcall-aixdesc must be big endian:  => 1:0

powerpc-randconfig

  + error: misc.c: undefined reference to `ftrace_likely_update':  =>
.text+0x22c), .text+0x898)

sh-randconfig

> [1] http://kisskb.ellerman.id.au/kisskb/head/7619/ (all 119 configs)
> [3] http://kisskb.ellerman.id.au/kisskb/head/7595/ (all 119 configs)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4] flexcan: add err_irq handler for flexcan

2014-07-01 Thread Zhao Qiang
when flexcan is not physically linked, command 'cantest' will
trigger an err_irq, add err_irq handler for it.

Signed-off-by: Zhao Qiang 
---
Changes for v2:
- use a space instead of tab
- use flexcan_poll_state instead of print
Changes for v3:
- return IRQ_HANDLED if err is triggered
- stop transmitted packets when there is an err_interrupt 
Changes for v4:
- call flexcan_irq 

 drivers/net/can/flexcan.c | 38 +-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index f425ec2..098fcac 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -208,6 +208,7 @@ struct flexcan_priv {
void __iomem *base;
u32 reg_esr;
u32 reg_ctrl_default;
+   int err_irq;
 
struct clk *clk_ipg;
struct clk *clk_per;
@@ -744,6 +745,27 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
return IRQ_HANDLED;
 }
 
+static irqreturn_t flexcan_err_irq(int irq, void *dev_id)
+{
+   struct net_device *dev = dev_id;
+   struct flexcan_priv *priv = netdev_priv(dev);
+   struct flexcan_regs __iomem *regs = priv->base;
+   u32 reg_ctrl, reg_esr;
+
+   reg_esr = flexcan_read(®s->esr);
+   reg_ctrl = flexcan_read(®s->ctrl);
+
+   if (reg_esr & FLEXCAN_ESR_ALL_INT) {
+   if (reg_esr & FLEXCAN_ESR_ERR_INT)
+   flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK,
+ ®s->ctrl);
+   flexcan_irq(irq, dev);
+   return IRQ_HANDLED;
+   }
+
+   return IRQ_NONE;
+}
+
 static void flexcan_set_bittiming(struct net_device *dev)
 {
const struct flexcan_priv *priv = netdev_priv(dev);
@@ -944,6 +966,15 @@ static int flexcan_open(struct net_device *dev)
if (err)
goto out_close;
 
+   if (priv->err_irq) {
+   err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
+ dev->name, dev);
+   if (err) {
+   free_irq(priv->err_irq, dev);
+   goto out_free_irq;
+   }
+   }
+
/* start chip and queuing */
err = flexcan_chip_start(dev);
if (err)
@@ -1099,7 +1130,7 @@ static int flexcan_probe(struct platform_device *pdev)
struct resource *mem;
struct clk *clk_ipg = NULL, *clk_per = NULL;
void __iomem *base;
-   int err, irq;
+   int err, irq, err_irq;
u32 clock_freq = 0;
 
if (pdev->dev.of_node)
@@ -1126,6 +1157,10 @@ static int flexcan_probe(struct platform_device *pdev)
if (irq <= 0)
return -ENODEV;
 
+   err_irq = platform_get_irq(pdev, 1);
+   if (err_irq <= 0)
+   err_irq = 0;
+
base = devm_ioremap_resource(&pdev->dev, mem);
if (IS_ERR(base))
return PTR_ERR(base);
@@ -1149,6 +1184,7 @@ static int flexcan_probe(struct platform_device *pdev)
dev->flags |= IFF_ECHO;
 
priv = netdev_priv(dev);
+   priv->err_irq = err_irq;
priv->can.clock.freq = clock_freq;
priv->can.bittiming_const = &flexcan_bittiming_const;
priv->can.do_set_mode = flexcan_set_mode;
-- 
1.8.5

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2] powerpc/kvm: support to handle sw breakpoint

2014-07-01 Thread Madhavan Srinivasan
This patch adds kernel side support for software breakpoint.
Design is that, by using an illegal instruction, we trap to hypervisor
via Emulation Assistance interrupt, where we check for the illegal instruction
and accordingly we return to Host or Guest. Patch also adds support for
software breakpoint in PR KVM.

Patch mandates use of "abs" instruction as sw breakpoint instruction
(primary opcode 31 and extended opcode 360). Based on PowerISA v2.01,
ABS instruction has been dropped from the architecture and treated an
illegal instruction.

Changes v1->v2:

 Moved the debug instruction #def to kvm_book3s.h. This way PR_KVM can also 
share it.
 Added code to use KVM get one reg infrastructure to get debug opcode.
 Updated emulate.c to include emulation of debug instruction incase of PR_KVM.
 Made changes to commit message.

Signed-off-by: Madhavan Srinivasan 
---
 arch/powerpc/include/asm/kvm_book3s.h |8 
 arch/powerpc/include/asm/ppc-opcode.h |5 +
 arch/powerpc/kvm/book3s.c |3 ++-
 arch/powerpc/kvm/book3s_hv.c  |9 +
 arch/powerpc/kvm/book3s_pr.c  |3 +++
 arch/powerpc/kvm/emulate.c|   10 ++
 6 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h 
b/arch/powerpc/include/asm/kvm_book3s.h
index f52f656..180d549 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -24,6 +24,14 @@
 #include 
 #include 
 
+/*
+ * KVMPPC_INST_BOOK3S_DEBUG is debug Instruction for supporting Software 
Breakpoint.
+ * Instruction mnemonic is ABS, primary opcode is 31 and extended opcode is 
360.
+ * Based on PowerISA v2.01, ABS instruction has been dropped from the 
architecture
+ * and treated an illegal instruction.
+ */
+#define KVMPPC_INST_BOOK3S_DEBUG   0x7c0002d0
+
 struct kvmppc_bat {
u64 raw;
u32 bepi;
diff --git a/arch/powerpc/include/asm/ppc-opcode.h 
b/arch/powerpc/include/asm/ppc-opcode.h
index 3132bb9..3fbb4c1 100644
--- a/arch/powerpc/include/asm/ppc-opcode.h
+++ b/arch/powerpc/include/asm/ppc-opcode.h
@@ -111,6 +111,11 @@
 #define OP_31_XOP_LHBRX 790
 #define OP_31_XOP_STHBRX918
 
+/* KVMPPC_INST_BOOK3S_DEBUG -- Software breakpoint Instruction
+ * Instruction mnemonic is ABS, primary opcode is 31 and extended opcode is 
360.
+ */
+#define OP_31_XOP_ABS  360
+
 #define OP_LWZ  32
 #define OP_LD   58
 #define OP_LWZU 33
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index c254c27..b40fe5d 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -789,7 +789,8 @@ int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
 int kvm_arch_vcpu_ioctl_set_guest_debug(struct kvm_vcpu *vcpu,
struct kvm_guest_debug *dbg)
 {
-   return -EINVAL;
+   vcpu->guest_debug = dbg->control;
+   return 0;
 }
 
 void kvmppc_decrementer_func(unsigned long data)
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 7a12edb..402c1ec 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -725,8 +725,14 @@ static int kvmppc_handle_exit_hv(struct kvm_run *run, 
struct kvm_vcpu *vcpu,
 * we don't emulate any guest instructions at this stage.
 */
case BOOK3S_INTERRUPT_H_EMUL_ASSIST:
+   if (kvmppc_get_last_inst(vcpu) == KVMPPC_INST_BOOK3S_DEBUG ) {
+   run->exit_reason = KVM_EXIT_DEBUG;
+   run->debug.arch.address = kvmppc_get_pc(vcpu);
+   r = RESUME_HOST;
+   } else {
kvmppc_core_queue_program(vcpu, SRR1_PROGILL);
r = RESUME_GUEST;
+   }
break;
/*
 * This occurs if the guest (kernel or userspace), does something that
@@ -831,6 +837,9 @@ static int kvmppc_get_one_reg_hv(struct kvm_vcpu *vcpu, u64 
id,
long int i;
 
switch (id) {
+   case KVM_REG_PPC_DEBUG_INST:
+   *val = get_reg_val(id, KVMPPC_INST_BOOK3S_DEBUG);
+   break;
case KVM_REG_PPC_HIOR:
*val = get_reg_val(id, 0);
break;
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
index 8eef1e5..27f5234 100644
--- a/arch/powerpc/kvm/book3s_pr.c
+++ b/arch/powerpc/kvm/book3s_pr.c
@@ -1229,6 +1229,9 @@ static int kvmppc_get_one_reg_pr(struct kvm_vcpu *vcpu, 
u64 id,
int r = 0;
 
switch (id) {
+   case KVM_REG_PPC_DEBUG_INST:
+   *val = get_reg_val(id, KVMPPC_INST_BOOK3S_DEBUG);
+   break;
case KVM_REG_PPC_HIOR:
*val = get_reg_val(id, to_book3s(vcpu)->hior);
break;
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index da86d9b..13fba51 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -363,6 +363,16 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct 
kvm_vcpu *vcpu)

[PATCH] dmaengine: fix xor sources continuation

2014-07-01 Thread xuelin.shi
From: Xuelin Shi 

the partial xor result must be kept until the next
tx is generated.

Signed-off-by: Xuelin Shi 
---
 crypto/async_tx/async_xor.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 3c562f5..e1bce26 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -78,8 +78,6 @@ do_async_xor(struct dma_chan *chan, struct 
dmaengine_unmap_data *unmap,
tx = dma->device_prep_dma_xor(chan, dma_dest, src_list,
  xor_src_cnt, unmap->len,
  dma_flags);
-   src_list[0] = tmp;
-
 
if (unlikely(!tx))
async_tx_quiesce(&submit->depend_tx);
@@ -92,6 +90,7 @@ do_async_xor(struct dma_chan *chan, struct 
dmaengine_unmap_data *unmap,
  xor_src_cnt, unmap->len,
  dma_flags);
}
+   src_list[0] = tmp;
 
dma_set_unmap(tx, unmap);
async_tx_submit(chan, tx, submit);
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 09/10] arm64,ia64,ppc,s390,sh,tile,um,x86,mm: Remove default gate area

2014-07-01 Thread Will Deacon
On Mon, Jun 30, 2014 at 10:53:20PM +0100, Andy Lutomirski wrote:
> The core mm code will provide a default gate area based on
> FIXADDR_USER_START and FIXADDR_USER_END if
> !defined(__HAVE_ARCH_GATE_AREA) && defined(AT_SYSINFO_EHDR).
> 
> This default is only useful for ia64.  arm64, ppc, s390, sh, tile,
> 64-bit UML, and x86_32 have their own code just to disable it.  arm,
> 32-bit UML, and x86_64 have gate areas, but they have their own
> implementations.
> 
> This gets rid of the default and moves the code into ia64.
> 
> This should save some code on architectures without a gate area: it's
> now possible to inline the gate_area functions in the default case.

For the arm64 bit:

  Acked-by: Will Deacon 

Will
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v4] flexcan: add err_irq handler for flexcan

2014-07-01 Thread Marc Kleine-Budde
On 07/01/2014 10:03 AM, Zhao Qiang wrote:
> when flexcan is not physically linked, command 'cantest' will
> trigger an err_irq, add err_irq handler for it.
> 
> Signed-off-by: Zhao Qiang 
> ---
> Changes for v2:
>   - use a space instead of tab
>   - use flexcan_poll_state instead of print
> Changes for v3:
>   - return IRQ_HANDLED if err is triggered
>   - stop transmitted packets when there is an err_interrupt 
> Changes for v4:
>   - call flexcan_irq 
> 
>  drivers/net/can/flexcan.c | 38 +-
>  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index f425ec2..098fcac 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -208,6 +208,7 @@ struct flexcan_priv {
>   void __iomem *base;
>   u32 reg_esr;
>   u32 reg_ctrl_default;
> + int err_irq;
>  
>   struct clk *clk_ipg;
>   struct clk *clk_per;
> @@ -744,6 +745,27 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
>   return IRQ_HANDLED;
>  }
>  
> +static irqreturn_t flexcan_err_irq(int irq, void *dev_id)
> +{
> + struct net_device *dev = dev_id;
> + struct flexcan_priv *priv = netdev_priv(dev);
> + struct flexcan_regs __iomem *regs = priv->base;
> + u32 reg_ctrl, reg_esr;
> +
> + reg_esr = flexcan_read(®s->esr);
> + reg_ctrl = flexcan_read(®s->ctrl);
> +
> + if (reg_esr & FLEXCAN_ESR_ALL_INT) {
> + if (reg_esr & FLEXCAN_ESR_ERR_INT)
> + flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK,
> +   ®s->ctrl);
> + flexcan_irq(irq, dev);

I still don't understand why you need a special flexcan_err_irq()
function. Why don't you just call:

request_irq(priv->err_irq, flexcan_irq, IRQF_SHARED, dev->name, dev);

instead?

> + return IRQ_HANDLED;
> + }
> +
> + return IRQ_NONE;
> +}
> +
>  static void flexcan_set_bittiming(struct net_device *dev)
>  {
>   const struct flexcan_priv *priv = netdev_priv(dev);
> @@ -944,6 +966,15 @@ static int flexcan_open(struct net_device *dev)
>   if (err)
>   goto out_close;
>  
> + if (priv->err_irq) {
> + err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
> +   dev->name, dev);
> + if (err) {
> + free_irq(priv->err_irq, dev);

Why do you want to free the err_irq, if requesting the err_irq fails?
However you should adjust all error cleanup path following this request
irq, so that it will be freed.

BTW: where is the corresponding free_irq() in flexcan_close()?

> + goto out_free_irq;
> + }
> + }
> +
>   /* start chip and queuing */
>   err = flexcan_chip_start(dev);
>   if (err)
> @@ -1099,7 +1130,7 @@ static int flexcan_probe(struct platform_device *pdev)
>   struct resource *mem;
>   struct clk *clk_ipg = NULL, *clk_per = NULL;
>   void __iomem *base;
> - int err, irq;
> + int err, irq, err_irq;
>   u32 clock_freq = 0;
>  
>   if (pdev->dev.of_node)
> @@ -1126,6 +1157,10 @@ static int flexcan_probe(struct platform_device *pdev)
>   if (irq <= 0)
>   return -ENODEV;
>  
> + err_irq = platform_get_irq(pdev, 1);
> + if (err_irq <= 0)
> + err_irq = 0;
> +
>   base = devm_ioremap_resource(&pdev->dev, mem);
>   if (IS_ERR(base))
>   return PTR_ERR(base);
> @@ -1149,6 +1184,7 @@ static int flexcan_probe(struct platform_device *pdev)
>   dev->flags |= IFF_ECHO;
>  
>   priv = netdev_priv(dev);
> + priv->err_irq = err_irq;
>   priv->can.clock.freq = clock_freq;
>   priv->can.bittiming_const = &flexcan_bittiming_const;
>   priv->can.do_set_mode = flexcan_set_mode;
> 

Marc

-- 
Pengutronix e.K.  | Marc Kleine-Budde   |
Industrial Linux Solutions| Phone: +49-231-2826-924 |
Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |



signature.asc
Description: OpenPGP digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Regression in 3.15 on POWER8 with multipath SCSI

2014-07-01 Thread Mike Snitzer
On Mon, Jun 30 2014 at  6:30am -0400,
Paul Mackerras  wrote:

> I have a machine on which 3.15 usually fails to boot, and 3.14 boots
> every time.  The machine is a POWER8 2-socket server with 20 cores
> (thus 160 CPUs), 128GB of RAM, and 7 SCSI disks connected via a
> hardware-RAID-capable adapter which appears as two IPR controllers
> which are both connected to each disk.  I am booting from a disk that
> has Fedora 20 installed on it.
> 
> After over two weeks of bisections, I can finally point to the commits
> that cause the problems.  The culprits are:
> 
> 3e9f1be1 dm mpath: remove process_queued_ios()
> e8099177 dm mpath: push back requests instead of queueing
> bcccff93 kobject: don't block for each kobject_uevent
> 
> The interesting thing is that neither e8099177 nor bcccff93 cause
> failures on their own, but with both commits in there are failures
> where the system will fail to find /home on some occasions.
> 
> With 3e9f1be1 included, the system appears to be prone to a deadlock
> condition which typically causes the boot process to hang with this
> message showing:
> 
> A start job is running for Monitoring of LVM2 mirror...rogress polling
> 
> (with a [*** ] thing before it where the asterisks move back and
> forth).
> 
> If I revert 63d832c3 ("dm mpath: really fix lockdep warning") ,
> 4cdd2ad7 ("dm mpath: fix lock order inconsistency in
> multipath_ioctl"), 3e9f1be1 and bcccff93, in that order, I get a
> kernel that will boot every time.  The first two are later commits
> that fix some problems with 3e9f1be1 (though not the problems I am
> seeing).
> 
> Can anyone see any reason why e8099177 and bcccff93 would interfere
> with each other?

No, not seeing any obvious relation.

But even though you listed e8099177 as a culprit you didn't list it as a
commit you reverted.  Did you leave e8099177 simply because attempting
to revert it fails (if you don't first revert other dm-mpath.c commits)?

(btw, Bart Van Assche also has issues with commit e8099177 due to hangs
during cable pull testing of mpath devices -- Bart: curious to know if
your cable pull tests pass if you just revert bcccff93).

Mike
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [1/3,v4] powerpc/fsl-booke: Add support for T2080/T2081 SoC

2014-07-01 Thread Scott Wood
On Wed, Jun 11, 2014 at 06:10:04PM +0800, Shengzhou Liu wrote:
> +/* controller at 0x24 */
> +&pci0 {
> + compatible = "fsl,t2080-pcie", "fsl,qoriq-pcie";

None of your patches add "fsl,qoriq-pcie" to of_device_ids[] in
corenet_generic.c, so PCIe will not get probed.

Worse, if I add that string, the kernel hangs trying to access a PCIe
controller that is disabled by the RCW.  This is because U-Boot is
expecting "fsl,qoriq-pcie-v3.0", and thus can't find the disabled node in
order to delete it.

Did you test PCIe at all on these boards?

Did you test other peripherals?

-Scott
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

RE: [PATCH v4] flexcan: add err_irq handler for flexcan

2014-07-01 Thread qiang.z...@freescale.com
On 07/01/2014 06:04 PM, Marc Kleine-Budde wrote:
> -Original Message-
> From: Marc Kleine-Budde [mailto:m...@pengutronix.de]
> Sent: Tuesday, July 01, 2014 6:04 PM
> To: Zhao Qiang-B45475; linuxppc-dev@lists.ozlabs.org; w...@grandegger.com;
> linux-...@vger.kernel.org; Wood Scott-B07421
> Subject: Re: [PATCH v4] flexcan: add err_irq handler for flexcan
> 
> On 07/01/2014 10:03 AM, Zhao Qiang wrote:
> > when flexcan is not physically linked, command 'cantest' will trigger
> > an err_irq, add err_irq handler for it.
> >
> > Signed-off-by: Zhao Qiang 
> > ---
> > Changes for v2:
> > - use a space instead of tab
> > - use flexcan_poll_state instead of print Changes for v3:
> > - return IRQ_HANDLED if err is triggered
> > - stop transmitted packets when there is an err_interrupt Changes
> for
> > v4:
> > - call flexcan_irq
> >
> >  drivers/net/can/flexcan.c | 38 +-
> >  1 file changed, 37 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> > index f425ec2..098fcac 100644
> > --- a/drivers/net/can/flexcan.c
> > +++ b/drivers/net/can/flexcan.c
> > @@ -208,6 +208,7 @@ struct flexcan_priv {
> > void __iomem *base;
> > u32 reg_esr;
> > u32 reg_ctrl_default;
> > +   int err_irq;
> >
> > struct clk *clk_ipg;
> > struct clk *clk_per;
> > @@ -744,6 +745,27 @@ static irqreturn_t flexcan_irq(int irq, void
> *dev_id)
> > return IRQ_HANDLED;
> >  }
> >
> > +static irqreturn_t flexcan_err_irq(int irq, void *dev_id) {
> > +   struct net_device *dev = dev_id;
> > +   struct flexcan_priv *priv = netdev_priv(dev);
> > +   struct flexcan_regs __iomem *regs = priv->base;
> > +   u32 reg_ctrl, reg_esr;
> > +
> > +   reg_esr = flexcan_read(®s->esr);
> > +   reg_ctrl = flexcan_read(®s->ctrl);
> > +
> > +   if (reg_esr & FLEXCAN_ESR_ALL_INT) {
> > +   if (reg_esr & FLEXCAN_ESR_ERR_INT)
> > +   flexcan_write(reg_ctrl & ~FLEXCAN_CTRL_ERR_MSK,
> > + ®s->ctrl);
> > +   flexcan_irq(irq, dev);
> 
> I still don't understand why you need a special flexcan_err_irq()
> function. Why don't you just call:
> 
> request_irq(priv->err_irq, flexcan_irq, IRQF_SHARED, dev->name, dev);
> 
> instead?

Flexcan_irq is for flexcan normal interrupt(such as Message Buffer, Wake up and 
so on).
And it will return IRQ_HANDLED if flexcan_irq is triggered.
But err_irq is shared with other devices, it should return IRQ_HANDLED when the 
interrupt 
is triggered by flexcan device, if not return IRQ_NONE.

> 
> > +   return IRQ_HANDLED;
> > +   }
> > +
> > +   return IRQ_NONE;
> > +}
> > +
> >  static void flexcan_set_bittiming(struct net_device *dev)  {
> > const struct flexcan_priv *priv = netdev_priv(dev); @@ -944,6
> > +966,15 @@ static int flexcan_open(struct net_device *dev)
> > if (err)
> > goto out_close;
> >
> > +   if (priv->err_irq) {
> > +   err = request_irq(priv->err_irq, flexcan_err_irq, IRQF_SHARED,
> > + dev->name, dev);
> > +   if (err) {
> > +   free_irq(priv->err_irq, dev);
> 
> Why do you want to free the err_irq, if requesting the err_irq fails?
> However you should adjust all error cleanup path following this request
> irq, so that it will be freed.
> 
> BTW: where is the corresponding free_irq() in flexcan_close()?

Here, I think you are right. Thanks for your reminder.
I will modify it.

> 
> > +   goto out_free_irq;
> > +   }
> > +   }
> > +
> > /* start chip and queuing */
> > err = flexcan_chip_start(dev);
> > if (err)
> > @@ -1099,7 +1130,7 @@ static int flexcan_probe(struct platform_device
> *pdev)
> > struct resource *mem;
> > struct clk *clk_ipg = NULL, *clk_per = NULL;
> > void __iomem *base;
> > -   int err, irq;
> > +   int err, irq, err_irq;
> > u32 clock_freq = 0;
> >
> > if (pdev->dev.of_node)
> > @@ -1126,6 +1157,10 @@ static int flexcan_probe(struct platform_device
> *pdev)
> > if (irq <= 0)
> > return -ENODEV;
> >
> > +   err_irq = platform_get_irq(pdev, 1);
> > +   if (err_irq <= 0)
> > +   err_irq = 0;
> > +
> > base = devm_ioremap_resource(&pdev->dev, mem);
> > if (IS_ERR(base))
> > return PTR_ERR(base);
> > @@ -1149,6 +1184,7 @@ static int flexcan_probe(struct platform_device
> *pdev)
> > dev->flags |= IFF_ECHO;
> >
> > priv = netdev_priv(dev);
> > +   priv->err_irq = err_irq;
> > priv->can.clock.freq = clock_freq;
> > priv->can.bittiming_const = &flexcan_bittiming_const;
> > priv->can.do_set_mode = flexcan_set_mode;
> >
> 
> Marc
> 
> --
> Pengutronix e.K.  | Marc Kleine-Budde   |
> Industrial Linux Solutions| Phone: +49-231-2826-924 |
> Vertretung West/Dortmund  | Fax:   +49-5121-206917- |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

__

[PATCH V3] powerpc/powernv: Check for IRQHAPPENED before sleeping

2014-07-01 Thread Preeti U Murthy
Commit 8d6f7c5a: "powerpc/powernv: Make it possible to skip the IRQHAPPENED
check in power7_nap()" added code that prevents cpus from checking for
pending interrupts just before entering sleep state, which is wrong. These
interrupts are delivered during the soft irq disabled state of the cpu.

A cpu cannot enter any idle state with pending interrupts because they will
never be serviced until the next time the cpu is woken up by some other
interrupt. Its only then that the pending interrupts are replayed. This can 
result
in device timeouts or warnings about this cpu being stuck.

This patch fixes ths issue by ensuring that cpus check for pending interrupts
just before entering any idle state as long as they are not in the path of split
core operations.

Signed-off-by: Preeti U Murthy 
---
Chanes in V2: https://lkml.org/lkml/2014/7/1/3
Modified the changelog to add the details of the problem that this patch
fixes

Changes in V3:
V2 assumed that this patch would be useful only in the context of doorbell
ipis. But that is not true; this patch is required to correctly handle any
type of interrupt delivered in the idle enter path.


 arch/powerpc/kernel/idle_power7.S |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/idle_power7.S 
b/arch/powerpc/kernel/idle_power7.S
index 2480256..5cf3d36 100644
--- a/arch/powerpc/kernel/idle_power7.S
+++ b/arch/powerpc/kernel/idle_power7.S
@@ -131,7 +131,7 @@ _GLOBAL(power7_nap)
 
 _GLOBAL(power7_sleep)
li  r3,1
-   li  r4,0
+   li  r4,1
b   power7_powersave_common
/* No return */
 

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] KVM: PPC: BOOK3S: HV: Update compute_tlbie_rb to handle 16MB base page

2014-07-01 Thread Paul Mackerras
On Sun, Jun 29, 2014 at 04:47:30PM +0530, Aneesh Kumar K.V wrote:
> When calculating the lower bits of AVA field, use the shift
> count based on the base page size. Also add the missing segment
> size and remove stale comment.
> 
> Signed-off-by: Aneesh Kumar K.V 

Acked-by: Paul Mackerras 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V3] powerpc/powernv: Check for IRQHAPPENED before sleeping

2014-07-01 Thread Michael Ellerman
On Wed, 2014-07-02 at 09:19 +0530, Preeti U Murthy wrote:
> Commit 8d6f7c5a: "powerpc/powernv: Make it possible to skip the IRQHAPPENED
> check in power7_nap()" added code that prevents cpus from checking for
> pending interrupts just before entering sleep state, which is wrong. These
> interrupts are delivered during the soft irq disabled state of the cpu.

Acked-by: Michael Ellerman 

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 4/6] KVM: PPC: BOOK3S: HV: Use new functions for mapping/unmapping hpte in host

2014-07-01 Thread Paul Mackerras
On Sun, Jun 29, 2014 at 04:47:33PM +0530, Aneesh Kumar K.V wrote:
> We want to use virtual page class key protection mechanism for
> indicating a MMIO mapped hpte entry or a guest hpte entry that is swapped out
> in the host. Those hptes will be marked valid, but have virtual page
> class key set to 30 or 31. These virtual page class numbers are
> configured in AMR to deny read/write. To accomodate such a change, add
> new functions that map, unmap and check whether a hpte is mapped in the
> host. This patch still use HPTE_V_VALID and HPTE_V_ABSENT and don't use
> virtual page class keys. But we want to differentiate in the code
> where we explicitly check for HPTE_V_VALID with places where we want to
> check whether the hpte is host mapped. This patch enables a closer
> review for such a change.

[...]

>   /* Check for pending invalidations under the rmap chain lock */
>   if (kvm->arch.using_mmu_notifiers &&
>   mmu_notifier_retry(kvm, mmu_seq)) {
> - /* inval in progress, write a non-present HPTE */
> - pteh |= HPTE_V_ABSENT;
> - pteh &= ~HPTE_V_VALID;
> + /*
> +  * inval in progress in host, write host unmapped pte.
> +  */
> + host_unmapped_hpte = 1;

This isn't right.  We already have HPTE_V_VALID set here, and you now
don't clear it here, and it doesn't get cleared by the
__kvmppc_unmap_host_hpte() call below either.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-01 Thread Michael Ellerman
On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote:
> (2014/06/30 20:36), Michael Ellerman wrote:
> > On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote:
> >> Ping? :)
> > 
> > Yeah sorry. I started looking at this and got dragged into another mess.
> > 
> > You seem to have duplicated the functionality of arch_deref_entry_point(),
> > which was also added for kprobes, and for the same reason - ie. because some
> > arches have strange function pointers. Is there some reason you can't use 
> > it?
> 
> Ah, right! Hmm, it seems some more work to update it. but basically, we can 
> do.
> BTW, is there any other users who need to access the actual function entry 
> (for
> kallsyms case)?

Not that I'm aware of. We have had function descriptors on 64-bit powerpc for
ever, so in theory by now we should have already found any cases where we need
that sort of wrapper.

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect

2014-07-01 Thread Paul Mackerras
On Sun, Jun 29, 2014 at 04:47:31PM +0530, Aneesh Kumar K.V wrote:
> This makes it consistent with h_enter where we clear the key
> bits. We also want to use virtual page class key protection mechanism
> for indicating host page fault. For that we will be using key class
> index 30 and 31. So prevent the guest from updating key bits until
> we add proper support for virtual page class protection mechanism for
> the guest. This will not have any impact for PAPR linux guest because
> Linux guest currently don't use virtual page class key protection model

As things stand, without this patch series, we do actually have
everything we need in the kernel for guests to use virtual page class
keys.  Arguably we should have a capability to tell userspace how many
storage keys the guest can use, but that's the only missing piece as
far as I can see.

If we add such a capability, I can't see any reason why we should need
to disable guest use of storage keys in this patchset.

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 5/6] KVM: PPC: BOOK3S: Use hpte_update_in_progress to track invalid hpte during an hpte update

2014-07-01 Thread Paul Mackerras
On Sun, Jun 29, 2014 at 04:47:34PM +0530, Aneesh Kumar K.V wrote:
> As per ISA, we first need to mark hpte invalid (V=0) before we update
> the hpte lower half bits. With virtual page class key protection mechanism we 
> want
> to send any fault other than key fault to guest directly without
> searching the hash page table. But then we can get NO_HPTE fault while
> we are updating the hpte. To track that add a vm specific atomic
> variable that we check in the fault path to always send the fault
> to host.

[...]

> @@ -750,13 +751,15 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, 
> struct kvm_vcpu *vcpu,
>   r &= rcbits | ~(HPTE_R_R | HPTE_R_C);
>  
>   if (be64_to_cpu(hptep[0]) & HPTE_V_VALID) {
> - /* HPTE was previously valid, so we need to invalidate it */
> + /*
> +  * If we had mapped this hpte before, we now need to
> +  * invalidate that.
> +  */
>   unlock_rmap(rmap);
> - /* Always mark HPTE_V_ABSENT before invalidating */
> - kvmppc_unmap_host_hpte(kvm, hptep);
>   kvmppc_invalidate_hpte(kvm, hptep, index);
>   /* don't lose previous R and C bits */
>   r |= be64_to_cpu(hptep[1]) & (HPTE_R_R | HPTE_R_C);
> + hpte_invalidated = true;

So now we're not setting the ABSENT bit before invalidating the HPTE.
That means that another guest vcpu could do an H_ENTER which could
think that this HPTE is free and use it for another unrelated guest
HPTE, which would be bad...

> @@ -1144,8 +1149,8 @@ static int kvm_test_clear_dirty_npages(struct kvm *kvm, 
> unsigned long *rmapp)
>   npages_dirty = n;
>   eieio();
>   }
> - kvmppc_map_host_hpte(kvm, &v, &r);
> - hptep[0] = cpu_to_be64(v & ~HPTE_V_HVLOCK);
> + hptep[0] = cpu_to_be64(v & ~HPTE_V_LOCK);
> + atomic_dec(&kvm->arch.hpte_update_in_progress);

Why are we using LOCK rather than HVLOCK now?  (And why didn't you
mention this change and its rationale in the patch description?)

Paul.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-01 Thread Masami Hiramatsu
(2014/07/02 13:41), Michael Ellerman wrote:
> On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote:
>> (2014/06/30 20:36), Michael Ellerman wrote:
>>> On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote:
 Ping? :)
>>>
>>> Yeah sorry. I started looking at this and got dragged into another mess.
>>>
>>> You seem to have duplicated the functionality of arch_deref_entry_point(),
>>> which was also added for kprobes, and for the same reason - ie. because some
>>> arches have strange function pointers. Is there some reason you can't use 
>>> it?
>>
>> Ah, right! Hmm, it seems some more work to update it. but basically, we can 
>> do.
>> BTW, is there any other users who need to access the actual function entry 
>> (for
>> kallsyms case)?
> 
> Not that I'm aware of. We have had function descriptors on 64-bit powerpc for
> ever, so in theory by now we should have already found any cases where we need
> that sort of wrapper.

OK, then I'll update this patch to use arch_deref_entry_point(), and add 
additional
patch which update to support PPC64 ABIv2.

Thank you!

-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu...@hitachi.com


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Re: Re: [PATCH v4] [BUGFIX] kprobes: Fix "Failed to find blacklist" error on ia64 and ppc64

2014-07-01 Thread Michael Ellerman
On Wed, 2014-07-02 at 15:39 +0900, Masami Hiramatsu wrote:
> (2014/07/02 13:41), Michael Ellerman wrote:
> > On Tue, 2014-07-01 at 11:21 +0900, Masami Hiramatsu wrote:
> >> (2014/06/30 20:36), Michael Ellerman wrote:
> >>> On Mon, 2014-06-30 at 12:14 +0900, Masami Hiramatsu wrote:
>  Ping? :)
> >>>
> >>> Yeah sorry. I started looking at this and got dragged into another mess.
> >>>
> >>> You seem to have duplicated the functionality of arch_deref_entry_point(),
> >>> which was also added for kprobes, and for the same reason - ie. because 
> >>> some
> >>> arches have strange function pointers. Is there some reason you can't use 
> >>> it?
> >>
> >> Ah, right! Hmm, it seems some more work to update it. but basically, we 
> >> can do.
> >> BTW, is there any other users who need to access the actual function entry 
> >> (for
> >> kallsyms case)?
> > 
> > Not that I'm aware of. We have had function descriptors on 64-bit powerpc 
> > for
> > ever, so in theory by now we should have already found any cases where we 
> > need
> > that sort of wrapper.
> 
> OK, then I'll update this patch to use arch_deref_entry_point(), and add 
> additional
> patch which update to support PPC64 ABIv2.

I've already done the latter:

  
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2f0143c91d30823f6f6e7d94d7fa818f7ab18a18

cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev