Skip to content

Commit ff5a199

Browse files
Linus Walleijarndb
authored andcommitted
bus: ixp4xx: Don't touch bit 7 on IXP42x
We face some regressions on a few IXP42x systems when accessing flash, the following unrelated error prints appear from the PCI driver: ixp4xx-pci c0000000.pci: PCI: abort_handler addr = 0xff9ffb5f, isr = 0x0, status = 0x22a0 ixp4xx-pci c0000000.pci: imprecise abort (...) It turns out that while bit 7 is masked "reserved" it is not unused, so masking it off as zero is dangerous, and breaks flash access on some systems such as the NSLU2. Be more careful and avoid masking off any of the reserved bits 7, 8, 9 or 30. Only keep masking EXP_WORD (bit 2) on IXP43x which is necessary in some setups. Fixes: 1c953bd ("bus: ixp4xx: Add a driver for IXP4xx expansion bus") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20221122134411.2030372-1-linus.walleij@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent abd6e3d commit ff5a199

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

drivers/bus/intel-ixp4xx-eb.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,14 @@
4949
#define IXP4XX_EXP_SIZE_SHIFT 10
5050
#define IXP4XX_EXP_CNFG_0 BIT(9) /* Always zero */
5151
#define IXP43X_EXP_SYNC_INTEL BIT(8) /* Only on IXP43x */
52-
#define IXP43X_EXP_EXP_CHIP BIT(7) /* Only on IXP43x */
52+
#define IXP43X_EXP_EXP_CHIP BIT(7) /* Only on IXP43x, dangerous to touch on IXP42x */
5353
#define IXP4XX_EXP_BYTE_RD16 BIT(6)
5454
#define IXP4XX_EXP_HRDY_POL BIT(5) /* Only on IXP42x */
5555
#define IXP4XX_EXP_MUX_EN BIT(4)
5656
#define IXP4XX_EXP_SPLT_EN BIT(3)
5757
#define IXP4XX_EXP_WORD BIT(2) /* Always zero */
5858
#define IXP4XX_EXP_WR_EN BIT(1)
5959
#define IXP4XX_EXP_BYTE_EN BIT(0)
60-
#define IXP42X_RESERVED (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(8)|BIT(7)|IXP4XX_EXP_WORD)
61-
#define IXP43X_RESERVED (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(5)|IXP4XX_EXP_WORD)
6260

6361
#define IXP4XX_EXP_CNFG0 0x20
6462
#define IXP4XX_EXP_CNFG0_MEM_MAP BIT(31)
@@ -252,10 +250,9 @@ static void ixp4xx_exp_setup_chipselect(struct ixp4xx_eb *eb,
252250
cs_cfg |= val << IXP4XX_EXP_CYC_TYPE_SHIFT;
253251
}
254252

255-
if (eb->is_42x)
256-
cs_cfg &= ~IXP42X_RESERVED;
257253
if (eb->is_43x) {
258-
cs_cfg &= ~IXP43X_RESERVED;
254+
/* Should always be zero */
255+
cs_cfg &= ~IXP4XX_EXP_WORD;
259256
/*
260257
* This bit for Intel strata flash is currently unused, but let's
261258
* report it if we find one.

0 commit comments

Comments
 (0)